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