2023-09-28 14:34:00 +08:00
|
|
|
package entity
|
|
|
|
|
|
|
|
import (
|
|
|
|
"joylink.club/ecs"
|
|
|
|
"joylink.club/rtsssimulation/component"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 创建断相保护器实体
|
|
|
|
func NewDBQEntity(w ecs.World, uid string, entityMap map[string]*ecs.Entry) *ecs.Entry {
|
|
|
|
entry, ok := entityMap[uid]
|
|
|
|
if !ok {
|
2023-10-07 17:03:34 +08:00
|
|
|
entry = w.Create(component.DBQTag, component.UidType, component.DBQStateType, component.CounterType)
|
2023-10-07 17:00:36 +08:00
|
|
|
component.UidType.SetValue(entry, component.Uid{Id: uid})
|
2023-09-28 14:34:00 +08:00
|
|
|
entityMap[uid] = entry
|
|
|
|
}
|
|
|
|
return entry
|
|
|
|
}
|