X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=dc84199c6be49025b35fe42a1feb1e6248d5bd8d;hb=dbd214ac278019c20c883cbb76456b0b0fddc063;hp=b86258e9f2bb892bb06309f3e29a9c39ff717dc2;hpb=07b8335e7bfd631e0878e183c87238812d632c56;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index b86258e..dc84199 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -6,6 +6,7 @@ #include "ChunkReceiver.hpp" #include "NetworkedInput.hpp" +#include "../app/ChatState.hpp" #include "../app/IntervalTimer.hpp" #include "../audio/SoundBank.hpp" #include "../graphics/SkyBox.hpp" @@ -31,13 +32,15 @@ class MasterState; class InteractiveState : public State -, public ClientController { +, public ClientController +, public ChatState::Responder { public: explicit InteractiveState(MasterState &, std::uint32_t player_id); World &GetWorld() noexcept { return world; } Player &GetPlayer() noexcept { return player; } + PlayerController &GetPlayerController() noexcept { return input; } ChunkReceiver &GetChunkReceiver() noexcept { return chunk_receiver; } void OnEnter() override; @@ -51,6 +54,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; @@ -58,6 +62,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 @@ -88,6 +94,8 @@ private: }; std::map update_status; + ChatState chat; + }; }