]> git.localhorst.tv Git - blank.git/blob - src/app/ClientState.cpp
special treatment for players
[blank.git] / src / app / ClientState.cpp
1 #include "ClientState.hpp"
2
3 #include "Environment.hpp"
4 #include "TextureIndex.hpp"
5
6 namespace blank {
7
8 ClientState::ClientState(
9         Environment &env,
10         const World::Config &wc,
11         const WorldSave &ws,
12         const Client::Config &cc
13 )
14 : env(env)
15 , block_types()
16 , world(block_types, wc, ws)
17 , client(cc, world) {
18
19 }
20
21
22 void ClientState::Handle(const SDL_Event &event) {
23         if (event.type == SDL_QUIT) {
24                 env.state.PopAll();
25         }
26 }
27
28
29 void ClientState::Update(int dt) {
30         client.Handle();
31         client.Update(dt);
32         if (client.TimedOut()) {
33                 env.state.Pop();
34         }
35 }
36
37
38 void ClientState::Render(Viewport &viewport) {
39
40 }
41
42 }