]> git.localhorst.tv Git - blank.git/blob - src/client/ChunkReceiver.hpp
basic message state
[blank.git] / src / client / ChunkReceiver.hpp
1 #ifndef BLANK_CLIENT_CHUNKRECEIVER_HPP_
2 #define BLANK_CLIENT_CHUNKRECEIVER_HPP_
3
4 #include "../app/IntervalTimer.hpp"
5 #include "../net/Packet.hpp"
6
7 #include <cstdint>
8 #include <list>
9
10
11 namespace blank {
12
13 class ChunkStore;
14
15 namespace client {
16
17 class ChunkTransmission;
18
19 class ChunkReceiver {
20
21 public:
22         explicit ChunkReceiver(ChunkStore &);
23         ~ChunkReceiver();
24
25         void Update(int dt);
26
27         void Handle(const Packet::ChunkBegin &);
28         void Handle(const Packet::ChunkData &);
29
30 private:
31         ChunkTransmission &GetTransmission(std::uint32_t id);
32         void Commit(ChunkTransmission &);
33
34 private:
35         ChunkStore &store;
36         std::list<ChunkTransmission> transmissions;
37         IntervalTimer timer;
38
39 };
40
41 }
42 }
43
44 #endif