iscs ecs 调整

This commit is contained in:
xzb 2023-12-19 11:13:01 +08:00
parent 5317c03689
commit dffafe98df

View File

@ -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关闭电源