X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FSimulation.hpp;h=31489c6de7aef91e20c93c1164771260eb251e62;hb=dd8b3145a03ed676b0ae6311c29fc3d68f666b15;hp=3025a745b5bebb3665174e3599faf99a4c8cccdf;hpb=c5556cf5f6813887a3503433c021ccd2e7fae865;p=blobs.git diff --git a/src/world/Simulation.hpp b/src/world/Simulation.hpp index 3025a74..31489c6 100644 --- a/src/world/Simulation.hpp +++ b/src/world/Simulation.hpp @@ -1,18 +1,25 @@ #ifndef BLOBS_WORLD_SIMULATION_HPP_ #define BLOBS_WORLD_SIMULATION_HPP_ -#include +#include "Set.hpp" +#include "../app/Assets.hpp" + +#include namespace blobs { namespace world { class Body; +class Planet; +class Resource; +class Sun; +class TileType; class Simulation { public: - explicit Simulation(Body &root); + explicit Simulation(Body &root, app::Assets &); ~Simulation(); Simulation(const Simulation &) = delete; @@ -22,18 +29,32 @@ public: Simulation &operator =(Simulation &&) = delete; public: - void Tick(); + 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; } + + app::Assets &Assets() noexcept { return assets; } + const app::Assets &Assets() const noexcept { return assets; } + const Set &Resources() const noexcept { return assets.data.resources; } + const Set &TileTypes() const noexcept { return assets.data.tile_types; } - Body &Root() { return root; } - const Body &Root() const { return root; } + const std::set &Bodies() const noexcept { return bodies; } + const std::set &Planets() const noexcept { return planets; } + const std::set &Suns() const noexcept { return suns; } double Time() const noexcept { return time; } private: Body &root; - std::vector all_bodies; + app::Assets &assets; + std::set bodies; + std::set planets; + std::set suns; double time; };