mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
feat: loading entities (WIP)
This commit is contained in:
parent
08cc78289d
commit
c8666910ce
16 changed files with 129 additions and 38 deletions
|
|
@ -172,8 +172,10 @@ public:
|
|||
entityid_t spawn(
|
||||
Assets* assets,
|
||||
EntityDef& def,
|
||||
glm::vec3 pos,
|
||||
dynamic::Value args=dynamic::NONE);
|
||||
Transform transform,
|
||||
dynamic::Value args=dynamic::NONE,
|
||||
dynamic::Map_sptr saved=nullptr,
|
||||
entityid_t uid=0);
|
||||
|
||||
std::optional<Entity> get(entityid_t id) {
|
||||
const auto& found = entities.find(id);
|
||||
|
|
@ -183,6 +185,8 @@ public:
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
void loadEntities(dynamic::Map_sptr map);
|
||||
void loadEntity(const dynamic::Map_sptr& map);
|
||||
void onSave(const Entity& entity);
|
||||
std::vector<Entity> getAllInside(AABB aabb);
|
||||
void despawn(entityid_t id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue