X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=ac8f87b054bf4bf98fc382b5924f1ec57a33b8f8;hb=b9462143d9b2fd1f54aa3b4ec32eecb62c01615f;hp=49c54745f8f88c57b94af1b52d6a7f72fb12fd68;hpb=fcb9cdbbb01dbe4a86981e1529df451d7d5e8256;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index 49c5474..ac8f87b 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -11,6 +11,7 @@ #include "../graphics/SkyBox.hpp" #include "../io/WorldSave.hpp" #include "../net/Packet.hpp" +#include "../shared/ChatState.hpp" #include "../shared/WorldResources.hpp" #include "../ui/HUD.hpp" #include "../ui/InteractiveManipulator.hpp" @@ -31,7 +32,8 @@ class MasterState; class InteractiveState : public State -, public ClientController { +, public ClientController +, public ChatState::Responder { public: explicit InteractiveState(MasterState &, std::uint32_t player_id); @@ -41,7 +43,11 @@ public: PlayerController &GetPlayerController() noexcept { return input; } ChunkReceiver &GetChunkReceiver() noexcept { return chunk_receiver; } - void OnEnter() override; + void OnResume() override; + void OnPause() override; + + void OnFocus() override; + void OnBlur() override; void Handle(const SDL_Event &) override; void Update(int dt) override; @@ -52,6 +58,7 @@ public: void Handle(const Packet::EntityUpdate &); void Handle(const Packet::PlayerCorrection &); void Handle(const Packet::BlockUpdate &); + void Handle(const Packet::Message &); void SetAudio(bool) override; void SetVideo(bool) override; @@ -59,6 +66,8 @@ public: void SetDebug(bool) override; void Exit() override; + void OnLineSubmit(const std::string &) override; + private: /// flag entity as updated by given packet /// returns false if the update should be ignored @@ -79,7 +88,8 @@ private: Interface interface; ChunkReceiver chunk_receiver; ChunkRenderer chunk_renderer; - IntervalTimer loop_timer; + CoarseTimer loop_timer; + CoarseTimer stat_timer; SkyBox sky; @@ -89,6 +99,11 @@ private: }; std::map update_status; + ChatState chat; + + int time_skipped; + unsigned int packets_skipped; + }; }