X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fclient%2FInteractiveState.hpp;h=91a5944181b2979b075ddce9b80af3d2657a5a48;hb=8507332e2d0c54aec4045fb6f0021bdc3bd57750;hp=efaeae425c03d869ef8df008ebad386793138b72;hpb=13e676a6e49128ebc6c63b8dd08bef51d360e8e9;p=blank.git diff --git a/src/client/InteractiveState.hpp b/src/client/InteractiveState.hpp index efaeae4..91a5944 100644 --- a/src/client/InteractiveState.hpp +++ b/src/client/InteractiveState.hpp @@ -1,13 +1,18 @@ #ifndef BLANK_CLIENT_INTERACTIVESTATE_HPP_ #define BLANK_CLIENT_INTERACTIVESTATE_HPP_ +#include "../app/IntervalTimer.hpp" #include "../app/State.hpp" #include "../io/WorldSave.hpp" +#include "../model/Skeletons.hpp" #include "../ui/Interface.hpp" #include "../world/BlockTypeRegistry.hpp" #include "../world/ChunkRenderer.hpp" +#include "../world/EntityState.hpp" #include "../world/World.hpp" +#include + namespace blank { @@ -25,6 +30,7 @@ public: World &GetWorld() noexcept { return world; } Interface &GetInterface() noexcept { return interface; } + Skeletons &GetSkeletons() noexcept { return skeletons; } void OnEnter() override; @@ -32,6 +38,9 @@ public: void Update(int dt) override; void Render(Viewport &) override; + void PushPlayerUpdate(const Entity &); + void MergePlayerCorrection(std::uint16_t, const EntityState &); + private: MasterState &master; BlockTypeRegistry block_types; @@ -39,6 +48,17 @@ private: World world; Interface interface; 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; };