]> git.localhorst.tv Git - blank.git/blob - src/app/ServerState.hpp
5a3c0dcacaac7c1b9feb5ac52c3e89bdfb0b0434
[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 "../net/Server.hpp"
7 #include "../world/BlockTypeRegistry.hpp"
8 #include "../world/World.hpp"
9
10
11 namespace blank {
12
13 class HeadlessEnvironment;
14
15 class ServerState
16 : public State {
17
18 public:
19         ServerState(
20                 HeadlessEnvironment &,
21                 const World::Config &,
22                 const WorldSave &,
23                 const Server::Config &
24         );
25
26         void Handle(const SDL_Event &) override;
27         void Update(int dt) override;
28         void Render(Viewport &) override;
29
30 private:
31         HeadlessEnvironment &env;
32         BlockTypeRegistry block_types;
33         World world;
34         Server server;
35         IntervalTimer push_timer;
36
37 };
38
39 }
40
41 #endif