]> git.localhorst.tv Git - blank.git/blob - src/app/ServerState.hpp
more packet introspection from payload
[blank.git] / src / app / ServerState.hpp
1 #ifndef BLANK_APP_SERVERSTATE_HPP_
2 #define BLANK_APP_SERVERSTATE_HPP_
3
4 #include "IntervalTimer.hpp"
5 #include "State.hpp"
6 #include "../ai/Spawner.hpp"
7 #include "../model/Skeletons.hpp"
8 #include "../net/Server.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 class ServerState
21 : public State {
22
23 public:
24         ServerState(
25                 HeadlessEnvironment &,
26                 const Generator::Config &,
27                 const World::Config &,
28                 const WorldSave &,
29                 const Server::Config &
30         );
31
32         void Handle(const SDL_Event &) override;
33         void Update(int dt) override;
34         void Render(Viewport &) override;
35
36 private:
37         HeadlessEnvironment &env;
38         BlockTypeRegistry block_types;
39         World world;
40         Generator generator;
41         ChunkLoader chunk_loader;
42         Skeletons skeletons;
43         Spawner spawner;
44         Server server;
45         IntervalTimer loop_timer;
46
47 };
48
49 }
50
51 #endif