X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=dc84199c6be49025b35fe42a1feb1e6248d5bd8d;hb=dbd214ac278019c20c883cbb76456b0b0fddc063;hp=2bc459a330a875e9fb748a9e0a10fda43f61c020;hpb=7e782291e0ce39eb2d4e8c1df28f682c313e6f8d;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index 2bc459a..dc84199 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -6,16 +6,16 @@ #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 "../model/ModelRegistry.hpp" -#include "../model/ShapeRegistry.hpp" #include "../net/Packet.hpp" +#include "../shared/WorldResources.hpp" #include "../ui/HUD.hpp" #include "../ui/InteractiveManipulator.hpp" #include "../ui/Interface.hpp" -#include "../world/BlockTypeRegistry.hpp" #include "../world/ChunkRenderer.hpp" #include "../world/EntityState.hpp" #include "../world/Player.hpp" @@ -32,15 +32,16 @@ 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; } - ModelRegistry &GetModels() noexcept { return models; } void OnEnter() override; @@ -53,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; @@ -60,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 @@ -69,9 +73,8 @@ private: private: MasterState &master; - ShapeRegistry shapes; - BlockTypeRegistry block_types; - ModelRegistry models; + WorldResources res; + SoundBank sounds; WorldSave save; World world; Player &player; @@ -91,6 +94,8 @@ private: }; std::map update_status; + ChatState chat; + }; }