]> git.localhorst.tv Git - blobs.git/blob - src/world/Simulation.hpp
more orbits and stuff
[blobs.git] / src / world / Simulation.hpp
1 #ifndef BLOBS_WORLD_SIMULATION_HPP_
2 #define BLOBS_WORLD_SIMULATION_HPP_
3
4 #include <vector>
5
6
7 namespace blobs {
8 namespace world {
9
10 class Body;
11
12 class Simulation {
13
14 public:
15         explicit Simulation(Body &root);
16         ~Simulation();
17
18         Simulation(const Simulation &) = delete;
19         Simulation &operator =(const Simulation &) = delete;
20
21         Simulation(Simulation &&) = delete;
22         Simulation &operator =(Simulation &&) = delete;
23
24 public:
25         void Tick();
26
27         void AddBody(Body &);
28
29         Body &Root() { return root; }
30         const Body &Root() const { return root; }
31
32         double Time() const noexcept { return time; }
33
34 private:
35         Body &root;
36         std::vector<Body *> all_bodies;
37         double time;
38
39 };
40
41 }
42 }
43
44 #endif