]> git.localhorst.tv Git - blobs.git/blob - src/world/Simulation.hpp
2f2239efe1d9c77b03b1bd10e7151a7c0c659a0c
[blobs.git] / src / world / Simulation.hpp
1 #ifndef BLOBS_WORLD_SIMULATION_HPP_
2 #define BLOBS_WORLD_SIMULATION_HPP_
3
4 #include "Set.hpp"
5
6 #include <set>
7
8
9 namespace blobs {
10 namespace world {
11
12 class Body;
13 class Planet;
14 class Resource;
15 class Sun;
16 class TileType;
17
18 class Simulation {
19
20 public:
21         explicit Simulation(Body &root, const Set<Resource> &, const Set<TileType> &);
22         ~Simulation();
23
24         Simulation(const Simulation &) = delete;
25         Simulation &operator =(const Simulation &) = delete;
26
27         Simulation(Simulation &&) = delete;
28         Simulation &operator =(Simulation &&) = delete;
29
30 public:
31         void Tick();
32
33         void AddBody(Body &);
34         void AddPlanet(Planet &);
35         void AddSun(Sun &);
36
37         Body &Root() noexcept { return root; }
38         const Body &Root() const noexcept { return root; }
39
40         const Set<Resource> &Resources() const noexcept { return resources; }
41         const Set<TileType> &TileTypes() const noexcept { return tile_types; }
42
43         const std::set<Body *> &Bodies() const noexcept { return bodies; }
44         const std::set<Planet *> &Planets() const noexcept { return planets; }
45         const std::set<Sun *> &Suns() const noexcept { return suns; }
46
47         double Time() const noexcept { return time; }
48
49 private:
50         Body &root;
51         const Set<Resource> &resources;
52         const Set<TileType> &tile_types;
53         std::set<Body *> bodies;
54         std::set<Planet *> planets;
55         std::set<Sun *> suns;
56         double time;
57
58 };
59
60 }
61 }
62
63 #endif