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