mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
feat: saving entities (WIP)
This commit is contained in:
parent
019a88ef84
commit
f0270d3391
24 changed files with 290 additions and 101 deletions
|
|
@ -21,6 +21,7 @@ struct entity_funcs_set {
|
|||
bool on_fall : 1;
|
||||
bool on_trigger_enter : 1;
|
||||
bool on_trigger_exit : 1;
|
||||
bool on_save : 1;
|
||||
};
|
||||
|
||||
struct EntityDef;
|
||||
|
|
@ -154,6 +155,7 @@ class Entities {
|
|||
entt::registry registry;
|
||||
Level* level;
|
||||
std::unordered_map<entityid_t, entt::entity> entities;
|
||||
std::unordered_map<entt::entity, entityid_t> uids;
|
||||
entityid_t nextID = 1;
|
||||
|
||||
void preparePhysics();
|
||||
|
|
@ -181,7 +183,9 @@ public:
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::vector<Entity> getAllInside(AABB aabb);
|
||||
void despawn(entityid_t id);
|
||||
dynamic::Value serialize(const Entity& entity);
|
||||
|
||||
inline size_t size() const {
|
||||
return entities.size();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue