X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fworld%2FSimulation.hpp;h=5df595fb26d0eab0c3d0b799a93f333b4bcf6270;hp=31489c6de7aef91e20c93c1164771260eb251e62;hb=392826deaf802ac0960ed3924a3f98b9d18d381b;hpb=b4deadd9f4e399207e2530ea39a447c0d9d260a3 diff --git a/src/world/Simulation.hpp b/src/world/Simulation.hpp index 31489c6..5df595f 100644 --- a/src/world/Simulation.hpp +++ b/src/world/Simulation.hpp @@ -1,13 +1,18 @@ #ifndef BLOBS_WORLD_SIMULATION_HPP_ #define BLOBS_WORLD_SIMULATION_HPP_ +#include "Record.hpp" #include "Set.hpp" #include "../app/Assets.hpp" #include +#include namespace blobs { +namespace creature { + class Creature; +} namespace world { class Body; @@ -31,10 +36,6 @@ public: public: void Tick(double dt); - void AddBody(Body &); - void AddPlanet(Planet &); - void AddSun(Sun &); - Body &Root() noexcept { return root; } const Body &Root() const noexcept { return root; } @@ -43,19 +44,40 @@ public: const Set &Resources() const noexcept { return assets.data.resources; } const Set &TileTypes() const noexcept { return assets.data.tile_types; } + void AddBody(Body &); + void AddPlanet(Planet &); + void AddSun(Sun &); + const std::set &Bodies() const noexcept { return bodies; } const std::set &Planets() const noexcept { return planets; } const std::set &Suns() const noexcept { return suns; } + void SetAlive(creature::Creature *); + std::vector &LiveCreatures() noexcept { return alive; } + const std::vector &LiveCreatures() const noexcept { return alive; } + + void SetDead(creature::Creature *); + std::vector &DeadCreatures() noexcept { return dead; } + const std::vector &DeadCreatures() const noexcept { return dead; } + double Time() const noexcept { return time; } + const std::vector &Records() const noexcept { return records; } + void CheckRecords(creature::Creature &) noexcept; + private: Body &root; app::Assets &assets; + std::set bodies; std::set planets; std::set suns; + + std::vector alive; + std::vector dead; + double time; + std::vector records; };