1 #ifndef BLANK_CLIENT_INTERACTIVESTATE_HPP_
2 #define BLANK_CLIENT_INTERACTIVESTATE_HPP_
4 #include "../app/IntervalTimer.hpp"
5 #include "../app/State.hpp"
6 #include "../io/WorldSave.hpp"
7 #include "../model/Skeletons.hpp"
8 #include "../ui/Interface.hpp"
9 #include "../world/BlockTypeRegistry.hpp"
10 #include "../world/ChunkRenderer.hpp"
11 #include "../world/EntityState.hpp"
12 #include "../world/World.hpp"
25 class InteractiveState
29 explicit InteractiveState(MasterState &, std::uint32_t player_id);
31 World &GetWorld() noexcept { return world; }
32 Interface &GetInterface() noexcept { return interface; }
33 Skeletons &GetSkeletons() noexcept { return skeletons; }
35 void OnEnter() override;
37 void Handle(const SDL_Event &) override;
38 void Update(int dt) override;
39 void Render(Viewport &) override;
41 void PushPlayerUpdate(const Entity &);
42 void MergePlayerCorrection(std::uint16_t, const EntityState &);
46 BlockTypeRegistry block_types;
50 ChunkRenderer chunk_renderer;
52 IntervalTimer loop_timer;
53 IntervalTimer update_timer;
55 struct PlayerHistory {
58 PlayerHistory(EntityState s, std::uint16_t p)
59 : state(s), packet(p) { }
61 std::list<PlayerHistory> player_hist;