This commit is contained in:
flswld
2023-03-27 22:41:43 +08:00
parent 568a329488
commit e912932b79
2 changed files with 19 additions and 7 deletions

View File

@@ -519,6 +519,17 @@ func (g *Group) GetEntityByConfigId(configId uint32) *Entity {
return nil
}
func (g *Group) DestroyEntity(entityId uint32) {
for _, suite := range g.suiteMap {
for _, entity := range suite.entityMap {
if entity.id == entityId {
delete(suite.entityMap, entity.id)
return
}
}
}
}
func (s *Suite) GetEntityById(entityId uint32) *Entity {
return s.entityMap[entityId]
}