about summary refs log tree commit diff stats
path: root/tools/validator/validator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/validator/validator.cpp')
-rw-r--r--tools/validator/validator.cpp51
1 files changed, 50 insertions, 1 deletions
diff --git a/tools/validator/validator.cpp b/tools/validator/validator.cpp index 4149caa..dd41f5c 100644 --- a/tools/validator/validator.cpp +++ b/tools/validator/validator.cpp
@@ -106,7 +106,8 @@ class Validator {
106 return false; 106 return false;
107 } 107 }
108 108
109 if (h_door.keyholders_size() > 0 || h_door.endings_size() > 0) { 109 if (h_door.keyholders_size() > 0 || h_door.endings_size() > 0 ||
110 h_door.complete_at() > 0) {
110 return true; 111 return true;
111 } 112 }
112 113
@@ -256,6 +257,22 @@ class Validator {
256 std::cout << "Port " << port_identifier.ShortDebugString() 257 std::cout << "Port " << port_identifier.ShortDebugString()
257 << " was defined multiple times." << std::endl; 258 << " was defined multiple times." << std::endl;
258 } 259 }
260
261 if (!port_info.target_connections_referenced_by.empty()) {
262 for (const HumanPort& port : port_info.definitions) {
263 if (port.has_required_door()) {
264 std::cout << "Port " << port_identifier.ShortDebugString()
265 << " has a required door but is the target of a connection:"
266 << std::endl;
267
268 for (const HumanConnection& connection :
269 port_info.target_connections_referenced_by) {
270 std::cout << " CONNECTION " << connection.ShortDebugString()
271 << std::endl;
272 }
273 }
274 }
275 }
259 } 276 }
260 277
261 void ValidatePainting(const PaintingIdentifier& painting_identifier, 278 void ValidatePainting(const PaintingIdentifier& painting_identifier,
@@ -279,6 +296,22 @@ class Validator {
279 std::cout << "Painting " << painting_identifier.ShortDebugString() 296 std::cout << "Painting " << painting_identifier.ShortDebugString()
280 << " was defined multiple times." << std::endl; 297 << " was defined multiple times." << std::endl;
281 } 298 }
299
300 if (!painting_info.target_connections_referenced_by.empty()) {
301 for (const HumanPainting& painting : painting_info.definitions) {
302 if (painting.has_required_door()) {
303 std::cout << "Painting " << painting_identifier.ShortDebugString()
304 << " has a required door but is the target of a connection:"
305 << std::endl;
306
307 for (const HumanConnection& connection :
308 painting_info.target_connections_referenced_by) {
309 std::cout << " CONNECTION " << connection.ShortDebugString()
310 << std::endl;
311 }
312 }
313 }
314 }
282 } 315 }
283 316
284 void ValidatePanel(const PanelIdentifier& panel_identifier, 317 void ValidatePanel(const PanelIdentifier& panel_identifier,
@@ -340,6 +373,22 @@ class Validator {
340 std::cout << "Panel " << panel_identifier.ShortDebugString() 373 std::cout << "Panel " << panel_identifier.ShortDebugString()
341 << " is missing an AP ID." << std::endl; 374 << " is missing an AP ID." << std::endl;
342 } 375 }
376
377 if (!panel_info.target_connections_referenced_by.empty()) {
378 for (const HumanPanel& panel : panel_info.definitions) {
379 if (panel.has_required_door()) {
380 std::cout << "Panel " << panel_identifier.ShortDebugString()
381 << " has a required door but is the target of a connection:"
382 << std::endl;
383
384 for (const HumanConnection& connection :
385 panel_info.target_connections_referenced_by) {
386 std::cout << " CONNECTION " << connection.ShortDebugString()
387 << std::endl;
388 }
389 }
390 }
391 }
343 } 392 }
344 393
345 void ValidateKeyholder(const KeyholderIdentifier& keyholder_identifier, 394 void ValidateKeyholder(const KeyholderIdentifier& keyholder_identifier,