]> git.localhorst.tv Git - blank.git/blob - src/server/ServerState.hpp
cube map textures
[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/Skeletons.hpp"
9 #include "../world/BlockTypeRegistry.hpp"
10 #include "../world/ChunkLoader.hpp"
11 #include "../world/Generator.hpp"
12 #include "../world/World.hpp"
13
14
15 namespace blank {
16
17 class HeadlessEnvironment;
18 class WorldSave;
19
20 namespace server {
21
22 class ServerState
23 : public State {
24
25 public:
26         ServerState(
27                 HeadlessEnvironment &,
28                 const Generator::Config &,
29                 const World::Config &,
30                 const WorldSave &,
31                 const Server::Config &
32         );
33
34         void Handle(const SDL_Event &) override;
35         void Update(int dt) override;
36         void Render(Viewport &) override;
37
38 private:
39         HeadlessEnvironment &env;
40         BlockTypeRegistry block_types;
41         World world;
42         Generator generator;
43         ChunkLoader chunk_loader;
44         Skeletons skeletons;
45         Spawner spawner;
46         Server server;
47         IntervalTimer loop_timer;
48
49 };
50
51 }
52 }
53
54 #endif