]> git.localhorst.tv Git - blank.git/blob - src/server/ServerState.hpp
load models from assets
[blank.git] / src / server / ServerState.hpp
1 #ifndef BLANK_SERVER_SERVERSTATE_HPP_
2 #define BLANK_SERVER_SERVERSTATE_HPP_
3
4 #include "Server.hpp"
5 #include "../ai/Spawner.hpp"
6 #include "../app/IntervalTimer.hpp"
7 #include "../app/State.hpp"
8 #include "../model/ModelRegistry.hpp"
9 #include "../model/ShapeRegistry.hpp"
10 #include "../world/BlockTypeRegistry.hpp"
11 #include "../world/ChunkLoader.hpp"
12 #include "../world/Generator.hpp"
13 #include "../world/World.hpp"
14
15
16 namespace blank {
17
18 class Config;
19 class HeadlessEnvironment;
20 class WorldSave;
21
22 namespace server {
23
24 class ServerState
25 : public State {
26
27 public:
28         ServerState(
29                 HeadlessEnvironment &,
30                 const Generator::Config &,
31                 const World::Config &,
32                 const WorldSave &,
33                 const Config &
34         );
35         ~ServerState();
36
37         void Handle(const SDL_Event &) override;
38         void Update(int dt) override;
39         void Render(Viewport &) override;
40
41 private:
42         HeadlessEnvironment &env;
43         ShapeRegistry shapes;
44         BlockTypeRegistry block_types;
45         ModelRegistry models;
46         World world;
47         Generator generator;
48         ChunkLoader chunk_loader;
49         Spawner spawner;
50         Server server;
51         IntervalTimer loop_timer;
52
53 };
54
55 }
56 }
57
58 #endif