X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=1129e997fdbcfd2f7d1377a73b9b7a61c9d5806a;hb=c1da86ebab41895bf49ed747c75ecf722e8c5586;hp=91a5944181b2979b075ddce9b80af3d2657a5a48;hpb=8507332e2d0c54aec4045fb6f0021bdc3bd57750;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index 91a5944..1129e99 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -1,18 +1,25 @@ #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 "ChunkRequester.hpp" +#include "NetworkedInput.hpp" +#include "../app/IntervalTimer.hpp" +#include "../graphics/SkyBox.hpp" #include "../io/WorldSave.hpp" #include "../model/Skeletons.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" -#include - namespace blank { @@ -23,13 +30,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; @@ -38,27 +47,31 @@ public: void Update(int dt) override; void Render(Viewport &) override; - void PushPlayerUpdate(const Entity &); void MergePlayerCorrection(std::uint16_t, const EntityState &); + void SetAudio(bool) override; + void SetVideo(bool) override; + void SetHUD(bool) override; + void SetDebug(bool) override; + void Exit() override; + private: MasterState &master; BlockTypeRegistry block_types; WorldSave save; World world; + Player &player; + HUD hud; + InteractiveManipulator manip; + NetworkedInput input; Interface interface; + ChunkRequester chunk_requester; + ChunkReceiver chunk_receiver; ChunkRenderer chunk_renderer; Skeletons skeletons; - IntervalTimer update_timer; - - struct PlayerHistory { - EntityState state; - int timestamp; - std::uint16_t packet; - PlayerHistory(EntityState s, int t, std::uint16_t p) - : state(s), timestamp(t), packet(p) { } - }; - std::list player_hist; + IntervalTimer loop_timer; + + SkyBox sky; };