From 704c08bb439b9a90f7be2d26a0c8b01777e2cf2c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 2 May 2023 00:24:09 -0400 Subject: Started reading in game data yaml --- game_data.h | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 game_data.h (limited to 'game_data.h') diff --git a/game_data.h b/game_data.h new file mode 100644 index 0000000..f74f033 --- /dev/null +++ b/game_data.h @@ -0,0 +1,86 @@ +#ifndef GAME_DATA_H_9C42AC51 +#define GAME_DATA_H_9C42AC51 + +#include +#include +#include + +enum class LingoColor { + kNone, + kBlack, + kRed, + kBlue, + kYellow, + kGreen, + kOrange, + kPurple, + kBrown, + kGray +}; + +struct Panel { + int room; + std::string name; + std::vector colors; + std::vector required_rooms; + std::vector required_doors; + bool check = false; + bool exclude_reduce = false; +}; + +struct Door { + int room; + std::string name; + std::string location_name; + std::string item_name; + std::string group_name; + bool skip_location = false; + std::vector panels; + bool exclude_reduce = true; +}; + +struct Exit { + int destination_room; + std::optional door; +}; + +struct Room { + std::string name; + std::vector exits; +}; + +struct Location { + std::string name; + int location_id; + int room; + std::vector panels; +}; + +struct MapArea { + std::string name; + std::vector locations; + int map_x; + int map_y; +}; + +class GameData { +public: + GameData(); + +private: + int AddOrGetRoom(std::string room); + int AddOrGetDoor(std::string room, std::string door); + int AddOrGetPanel(std::string room, std::string panel); + + std::vector rooms_; + std::vector doors_; + std::vector panels_; + + std::map room_by_id_; + std::map door_by_id_; + std::map panel_by_id_; +}; + +const GameData &GetGameData(); + +#endif /* end of include guard: GAME_DATA_H_9C42AC51 */ -- cgit 1.4.1