group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
RegistrySerialization.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "entt/entity/fwd.hpp"
5
6#include <entt/entt.hpp>
7#include <optional>
8#include <vector>
9
11{
12
14{
15 entt::entity entity{entt::null};
17};
18
19std::vector<uint8_t> serialize(const entt::registry& registry);
20
21class Loader
22{
23public:
24 explicit Loader(entt ::registry& registry) : registry(registry), loader(registry) {}
25 void apply(const uint8_t* data, size_t size, std::optional<entt::entity> localPlayerServerEntity = std::nullopt);
26 [[nodiscard]] entt::entity map(entt::entity) const;
27
28private:
29 entt::registry& registry;
30 entt::continuous_loader loader;
31};
32
33} // namespace registry_serialization
Per-tick player input snapshot for networking and prediction.
Definition RegistrySerialization.hpp:22
entt::entity map(entt::entity) const
Definition RegistrySerialization.cpp:121
Loader(entt ::registry &registry)
Definition RegistrySerialization.hpp:24
void apply(const uint8_t *data, size_t size, std::optional< entt::entity > localPlayerServerEntity=std::nullopt)
Definition RegistrySerialization.cpp:79
Definition RegistrySerialization.cpp:34
std::vector< uint8_t > serialize(const entt::registry &registry)
Definition RegistrySerialization.cpp:49
One tick of player input, stamped with the tick it was sampled on.
Definition InputSnapshot.hpp:17
Definition RegistrySerialization.hpp:14
InputSnapshot input
Definition RegistrySerialization.hpp:16
entt::entity entity
Definition RegistrySerialization.hpp:15