18 lines
464 B
Go
18 lines
464 B
Go
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 {
|
|
entry = w.Entry(w.Create(component.DBQTag, component.UidType, component.DBQStateType, component.CounterType))
|
|
component.UidType.SetValue(entry, component.Uid{Id: uid})
|
|
entityMap[uid] = entry
|
|
}
|
|
return entry
|
|
}
|