1 #ifndef BLANK_CLIENT_CLIENTSTATE_HPP_
2 #define BLANK_CLIENT_CLIENTSTATE_HPP_
4 #include "InitialState.hpp"
5 #include "InteractiveState.hpp"
6 #include "../app/State.hpp"
7 #include "../net/Client.hpp"
8 #include "../net/ConnectionHandler.hpp"
19 class InteractiveState;
23 , public ConnectionHandler {
28 const World::Config &,
29 const Interface::Config &,
30 const Client::Config &
33 Client &GetClient() noexcept { return client; }
34 Environment &GetEnv() noexcept { return env; }
36 World::Config &GetWorldConf() noexcept { return world_conf; }
37 const World::Config &GetWorldConf() const noexcept { return world_conf; }
38 const Interface::Config &GetInterfaceConf() const noexcept { return intf_conf; }
39 const Client::Config &GetClientConf() const noexcept { return client_conf; }
43 void OnEnter() override;
45 void Handle(const SDL_Event &) override;
46 void Update(int dt) override;
47 void Render(Viewport &) override;
49 void OnPacketLost(std::uint16_t) override;
50 void OnTimeout() override;
52 void On(const Packet::Join &) override;
53 void On(const Packet::Part &) override;
57 World::Config world_conf;
58 const Interface::Config &intf_conf;
59 const Client::Config &client_conf;
60 std::unique_ptr<InteractiveState> state;
63 InitialState init_state;