1 #ifndef BLANK_CLIENT_INTERACTIVESTATE_HPP_
2 #define BLANK_CLIENT_INTERACTIVESTATE_HPP_
4 #include "../app/State.hpp"
5 #include "../ui/ClientController.hpp"
7 #include "ChunkReceiver.hpp"
8 #include "ChunkRequester.hpp"
9 #include "NetworkedInput.hpp"
10 #include "../app/IntervalTimer.hpp"
11 #include "../graphics/SkyBox.hpp"
12 #include "../io/WorldSave.hpp"
13 #include "../model/Skeletons.hpp"
14 #include "../net/Packet.hpp"
15 #include "../ui/HUD.hpp"
16 #include "../ui/InteractiveManipulator.hpp"
17 #include "../ui/Interface.hpp"
18 #include "../world/BlockTypeRegistry.hpp"
19 #include "../world/ChunkRenderer.hpp"
20 #include "../world/EntityState.hpp"
21 #include "../world/Player.hpp"
22 #include "../world/World.hpp"
33 class InteractiveState
35 , public ClientController {
38 explicit InteractiveState(MasterState &, std::uint32_t player_id);
40 World &GetWorld() noexcept { return world; }
41 Player &GetPlayer() noexcept { return player; }
42 ChunkReceiver &GetChunkReceiver() noexcept { return chunk_receiver; }
43 Skeletons &GetSkeletons() noexcept { return skeletons; }
45 void OnEnter() override;
47 void Handle(const SDL_Event &) override;
48 void Update(int dt) override;
49 void Render(Viewport &) override;
51 void MergePlayerCorrection(std::uint16_t, const EntityState &);
52 void Handle(const Packet::BlockUpdate &);
54 void SetAudio(bool) override;
55 void SetVideo(bool) override;
56 void SetHUD(bool) override;
57 void SetDebug(bool) override;
62 BlockTypeRegistry block_types;
67 InteractiveManipulator manip;
70 ChunkRequester chunk_requester;
71 ChunkReceiver chunk_receiver;
72 ChunkRenderer chunk_renderer;
74 IntervalTimer loop_timer;