From c9a21a387634e8fdd13110906ebe786f055c446d Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 3 Aug 2023 11:34:57 -0400 Subject: LEVEL 2 and required_panel support --- src/game_data.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/game_data.cpp') diff --git a/src/game_data.cpp b/src/game_data.cpp index 9d4dae0..fafc88c 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp @@ -125,6 +125,7 @@ struct GameData { int panel_id = AddOrGetPanel(room_obj.name, panel_it.first.as()); Panel &panel_obj = panels_[panel_id]; + room_obj.panels.push_back(panel_id); if (panel_it.second["colors"]) { if (panel_it.second["colors"].IsScalar()) { @@ -174,6 +175,29 @@ struct GameData { } } + if (panel_it.second["required_panel"]) { + if (panel_it.second["required_panel"].IsMap()) { + std::string rp_room = room_obj.name; + if (panel_it.second["required_panel"]["room"]) { + rp_room = panel_it.second["required_panel"]["room"].as(); + } + + panel_obj.required_panels.push_back(AddOrGetPanel( + rp_room, panel_it.second["required_panel"]["panel"] + .as())); + } else { + for (const auto &rp_node : panel_it.second["required_panel"]) { + std::string rp_room = room_obj.name; + if (rp_node["room"]) { + rp_room = rp_node["room"].as(); + } + + panel_obj.required_panels.push_back( + AddOrGetPanel(rp_room, rp_node["panel"].as())); + } + } + } + if (panel_it.second["check"]) { panel_obj.check = panel_it.second["check"].as(); } @@ -189,6 +213,10 @@ struct GameData { panel_obj.exclude_reduce = panel_it.second["exclude_reduce"].as(); } + + if (panel_it.second["non_counting"]) { + panel_obj.non_counting = panel_it.second["non_counting"].as(); + } } } -- cgit 1.4.1