X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=86757a294c10501dd28c074a28ba59410220bb59;hb=bc2806164f55b7ac48dbb6d224b7d4b55683decf;hp=9b1ce52236309d23751286b037e2d80ead35701f;hpb=d2eb51ad9759eeee743b04aee6f1ae69132fc706;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index 9b1ce52..86757a2 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -1,13 +1,24 @@ #ifndef BLANK_CLIENT_INTERACTIVESTATE_HPP_ #define BLANK_CLIENT_INTERACTIVESTATE_HPP_ -#include "../app/IntervalTimer.hpp" #include "../app/State.hpp" +#include "../ui/ClientController.hpp" + +#include "ChunkReceiver.hpp" +#include "NetworkedInput.hpp" +#include "../app/IntervalTimer.hpp" +#include "../graphics/SkyBox.hpp" #include "../io/WorldSave.hpp" +#include "../model/ShapeRegistry.hpp" #include "../model/Skeletons.hpp" +#include "../net/Packet.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" #include "../world/World.hpp" @@ -20,13 +31,15 @@ namespace client { class MasterState; class InteractiveState -: public State { +: public State +, public ClientController { public: explicit InteractiveState(MasterState &, std::uint32_t player_id); World &GetWorld() noexcept { return world; } - Interface &GetInterface() noexcept { return interface; } + Player &GetPlayer() noexcept { return player; } + ChunkReceiver &GetChunkReceiver() noexcept { return chunk_receiver; } Skeletons &GetSkeletons() noexcept { return skeletons; } void OnEnter() override; @@ -35,15 +48,32 @@ public: void Update(int dt) override; void Render(Viewport &) override; + void MergePlayerCorrection(std::uint16_t, const EntityState &); + void Handle(const Packet::BlockUpdate &); + + void SetAudio(bool) override; + void SetVideo(bool) override; + void SetHUD(bool) override; + void SetDebug(bool) override; + void Exit() override; + private: MasterState &master; + ShapeRegistry shapes; BlockTypeRegistry block_types; WorldSave save; World world; + Player &player; + HUD hud; + InteractiveManipulator manip; + NetworkedInput input; Interface interface; + ChunkReceiver chunk_receiver; ChunkRenderer chunk_renderer; Skeletons skeletons; - IntervalTimer update_timer; + IntervalTimer loop_timer; + + SkyBox sky; };