#ifndef HOLESOME_MAP_SIMULATION_HPP #define HOLESOME_MAP_SIMULATION_HPP #include #include #include #include "../../player/player.hpp" #include "map_player.hpp" class MapSimulation : public GameObject { public: MapSimulation(); void update() override; void physicsUpdate() override; void resetMap(sf::Vector2 worldMapSize); static std::shared_ptr getInstance(); void addPlayer(const std::shared_ptr& player); [[nodiscard]] std::shared_ptr getMapPlayerByBody(b2Body* body) const; private: static inline std::shared_ptr singletonInstance = nullptr; std::shared_ptr world; std::map> mapPlayersById; void constructSquareObstacle(float minX, float minY, float maxX, float maxY); void removePlayer(std::shared_ptr &player); }; #endif //HOLESOME_MAP_SIMULATION_HPP