mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add entity:get_player()
This commit is contained in:
parent
65fec4f4a9
commit
9cd3f3e4c8
5 changed files with 33 additions and 3 deletions
|
|
@ -34,6 +34,7 @@ struct EntityId {
|
|||
entityid_t uid;
|
||||
const EntityDef& def;
|
||||
bool destroyFlag = false;
|
||||
int64_t player = -1;
|
||||
};
|
||||
|
||||
struct Transform {
|
||||
|
|
@ -161,6 +162,14 @@ public:
|
|||
return entity;
|
||||
}
|
||||
|
||||
int64_t getPlayer() const {
|
||||
return registry.get<EntityId>(entity).player;
|
||||
}
|
||||
|
||||
void setPlayer(int64_t id) {
|
||||
registry.get<EntityId>(entity).player = id;
|
||||
}
|
||||
|
||||
void destroy();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue