From 149e7c0836927e14a926a952bd1a7f0d1b49e779 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 5 May 2023 15:46:58 -0400 Subject: Organised repo --- src/game_data.h | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 src/game_data.h (limited to 'src/game_data.h') diff --git a/src/game_data.h b/src/game_data.h new file mode 100644 index 0000000..0cc7a7b --- /dev/null +++ b/src/game_data.h @@ -0,0 +1,135 @@ +#ifndef GAME_DATA_H_9C42AC51 +#define GAME_DATA_H_9C42AC51 + +#include +#include +#include +#include + +enum class LingoColor { + kNone, + kBlack, + kRed, + kBlue, + kYellow, + kGreen, + kOrange, + kPurple, + kBrown, + kGray +}; + +struct Panel { + int id; + int room; + std::string name; + std::vector colors; + std::vector required_rooms; + std::vector required_doors; + bool check = false; + bool exclude_reduce = false; + bool achievement = false; +}; + +struct ProgressiveRequirement { + std::string item_name; + int quantity = 0; +}; + +struct Door { + int room; + std::string name; + std::string location_name; + std::string item_name; + std::string group_name; + bool skip_location = false; + bool skip_item = false; + std::vector panels; + bool exclude_reduce = true; + std::vector progressives; +}; + +struct Exit { + int destination_room; + std::optional door; + bool painting = false; +}; + +struct PaintingExit { + std::string id; + std::optional door; +}; + +struct Room { + std::string name; + std::vector exits; + std::vector paintings; +}; + +struct Location { + std::string name; + std::string ap_location_name; + int room; + std::vector panels; +}; + +struct MapArea { + int id; + std::string name; + std::vector locations; + int map_x; + int map_y; +}; + +class GameData { + public: + GameData(); + + const std::vector& GetMapAreas() const { return map_areas_; } + + const MapArea& GetMapArea(int id) const { return map_areas_.at(id); } + + int GetRoomByName(const std::string& name) const { + return room_by_id_.at(name); + } + + const Room& GetRoom(int room_id) const { return rooms_.at(room_id); } + + const std::vector& GetDoors() const { return doors_; } + + const Door& GetDoor(int door_id) const { return doors_.at(door_id); } + + const Panel& GetPanel(int panel_id) const { return panels_.at(panel_id); } + + int GetRoomForPainting(const std::string& painting_id) const { + return room_by_painting_.at(painting_id); + } + + const std::vector& GetAchievementPanels() const { + return achievement_panels_; + } + + private: + int AddOrGetRoom(std::string room); + int AddOrGetDoor(std::string room, std::string door); + int AddOrGetPanel(std::string room, std::string panel); + int AddOrGetArea(std::string area); + + std::vector rooms_; + std::vector doors_; + std::vector panels_; + std::vector map_areas_; + + std::map room_by_id_; + std::map door_by_id_; + std::map panel_by_id_; + std::map area_by_id_; + + std::map room_by_painting_; + + std::vector achievement_panels_; +}; + +const GameData& GetGameData(); + +#endif /* end of include guard: GAME_DATA_H_9C42AC51 */ -- cgit 1.4.1