rts-sim-module/entity/dbq.go
walker 9401b15142 组件调整
实体加载调整
继电器、断相保护器、道岔转辙机、道岔、道岔电路等系统调整
继电器、道岔对外接口调整
2024-01-12 18:20:21 +08:00

20 lines
474 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
}