56 lines
1.4 KiB
C++
56 lines
1.4 KiB
C++
//
|
|
// Created by sebastian on 08.02.26.
|
|
//
|
|
|
|
#ifndef GAMEMODE_H
|
|
#define GAMEMODE_H
|
|
#include <memory>
|
|
#include <optional>
|
|
|
|
#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<RessourceType, int> & pairs);
|
|
std::optional<BuildingType> 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<PlayerID, Player> players;
|
|
std::optional<BuildingType> activeBuilding;
|
|
|
|
bool upgradeMode = false;
|
|
};
|
|
|
|
|
|
|
|
#endif //GAMEMODE_H
|