rts-sim-module/entity/dbq.go

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