// // Created by sebastian on 08.02.26. // #ifndef GAMEMODE_H #define GAMEMODE_H #include #include #include "../engine/core/ECS/EntityManager.h" #include "hexWorld/ecs/components/BuildingComponent.h" #include "hexWorld/ecs/components/ProducingComponent.h" #include "player/Player.h" class GameMode { public: GameMode(); bool canBuild(EntityID player, BuildingType buildingType); bool canAfford(PlayerID player_id, RessourceType ressource, int amount) const; void build(EntityID player, EntityID tileEntity, BuildingType buildingType); void addPlayer(PlayerID playerID, std::string name); PlayerID getCurrentPlayer(); PlayerInventory& getPlayerInventory(PlayerID playerID); void pay(PlayerID uint32, const std::unordered_map & pairs); std::optional getActiveBuilding() const; void clearActiveBuilding(); void setActiveBuilding(BuildingType buildingType); size_t getPlayerCount() const; bool hasTurn(PlayerID playerID, int turn) const; bool getCurrentTurnPlayer(int turn) const; void addResource(PlayerID uint32, RessourceType ressource, int get_storage); glm::vec3 getColorOfPlayer(PlayerID playerID); void setUpgradeMode(bool upgradeMode); bool isUpgradeMode() const; private: std::unordered_map players; std::optional activeBuilding; bool upgradeMode = false; }; #endif //GAMEMODE_H