X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=dc84199c6be49025b35fe42a1feb1e6248d5bd8d;hb=f21a21b285c5b54e3abcc757c6715d22520dd190;hp=02385e2e5a5ff6904aa1031d3ebd12ed61759a0a;hpb=9c5308ba4108bd842af6d9d2e893ea575a7e6ca8;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index 02385e2..dc84199 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -6,7 +6,9 @@ #include "ChunkReceiver.hpp" #include "NetworkedInput.hpp" +#include "../app/ChatState.hpp" #include "../app/IntervalTimer.hpp" +#include "../audio/SoundBank.hpp" #include "../graphics/SkyBox.hpp" #include "../io/WorldSave.hpp" #include "../net/Packet.hpp" @@ -30,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; @@ -50,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; @@ -57,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 @@ -67,6 +74,7 @@ private: private: MasterState &master; WorldResources res; + SoundBank sounds; WorldSave save; World world; Player &player; @@ -86,6 +94,8 @@ private: }; std::map update_status; + ChatState chat; + }; }