]> git.localhorst.tv Git - blank.git/blob - src/server/ServerState.hpp
lil cleanup of common and unused stuff
[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 "../shared/WorldResources.hpp"
9 #include "../world/ChunkLoader.hpp"
10 #include "../world/Generator.hpp"
11 #include "../world/World.hpp"
12
13
14 namespace blank {
15
16 class Config;
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 Config &
32         );
33         ~ServerState();
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         WorldResources res;
42         World world;
43         Generator generator;
44         ChunkLoader chunk_loader;
45         Spawner spawner;
46         Server server;
47         IntervalTimer loop_timer;
48
49 };
50
51 }
52 }
53
54 #endif