add entity:get_player()

This commit is contained in:
MihailRis
2025-01-16 06:50:01 +03:00
parent 65fec4f4a9
commit 9cd3f3e4c8
5 changed files with 33 additions and 3 deletions
+9
View File
@@ -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();
};