iscs ecs 调整
This commit is contained in:
parent
5317c03689
commit
dffafe98df
@ -8,29 +8,6 @@ import (
|
||||
"joylink.club/rtsssimulation/entity"
|
||||
)
|
||||
|
||||
// DeviceHandTagOperate 设备设置手型图标操作
|
||||
func DeviceHandTagOperate(w ecs.World, deviceId string, hand bool) error {
|
||||
r := <-ecs.Request[ecs.EmptyType](w, func() ecs.Result[ecs.EmptyType] {
|
||||
wd := entity.GetWorldData(w)
|
||||
deviceEntry, ok := wd.EntityMap[deviceId]
|
||||
if !ok {
|
||||
return ecs.NewErrResult(fmt.Errorf("设备[%s]实体不存在", deviceId))
|
||||
}
|
||||
if hand {
|
||||
if !deviceEntry.HasComponent(component.HandTag) {
|
||||
deviceEntry.AddComponent(component.HandTag)
|
||||
}
|
||||
} else {
|
||||
if deviceEntry.HasComponent(component.HandTag) {
|
||||
deviceEntry.RemoveComponent(component.HandTag)
|
||||
}
|
||||
}
|
||||
//
|
||||
return ecs.NewOkEmptyResult()
|
||||
})
|
||||
return r.Err
|
||||
}
|
||||
|
||||
// CommonFanOperate 一般风机控制,如排烟风机、正压送风机、射流风机、普通风机、硬线风机
|
||||
//
|
||||
// power : 风机电源,大于0接通正转相序电源,小于0接通反转相序电源,等于0关闭电源
|
||||
|
Loading…
Reference in New Issue
Block a user