46 [[nodiscard]]
const Snapshot*
find(std::uint32_t tick)
const noexcept;
49 [[nodiscard]] std::size_t
size() const noexcept;
52 [[nodiscard]] std::uint64_t
dropped() const noexcept;
56 std::optional<std::uint32_t> baseline;
57 std::vector<DeltaSnapshot> parts;
60 [[nodiscard]]
static std::uint32_t tick_of(
const Rebuilt& kept)
noexcept;
61 [[nodiscard]]
const Rebuilt* entry(std::uint32_t tick)
const noexcept;
63 std::optional<Snapshot> drop() noexcept;
65 std::deque<Rebuilt> kept_;
66 std::uint64_t dropped_ = 0;
Rebuilds the snapshots of the server from the payloads of its Snapshot datagrams.
Definition snapshot_decoder.hpp:22
const Snapshot * find(std::uint32_t tick) const noexcept
A snapshot kept.
bool decodable(const DeltaSnapshot &part) const noexcept
Tells whether a payload can be decoded: a full snapshot, or a delta whose baseline is kept.
std::size_t size() const noexcept
Number of snapshots kept.
std::optional< Snapshot > decode(const DeltaSnapshot &part)
Rebuilds the snapshot of a payload, with the payloads of its tick received so far.
std::uint64_t dropped() const noexcept
Number of payloads dropped by decode().
static constexpr std::size_t capacity
Snapshots kept, as many as the server keeps per client.
Definition snapshot_decoder.hpp:25
Snapshots encoded against a baseline the client acknowledged: only what changed.
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16
Snapshots of the world sent to the clients (RFC section 4.3).
One payload of a snapshot encoded against a baseline.
Definition delta_snapshot.hpp:57
The state of the world at one tick.
Definition snapshot.hpp:94