rts-sim-module/deprecated/entities/button_entity.go
walker 0bba8f0934 删除donburi包引用
修改filter导入为从ecs项目导入
整理包结构,将弃用的包放入deprecated文件中
2023-10-09 11:17:25 +08:00

24 lines
951 B
Go

package entities
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/deprecated/system"
)
// CreateSelfResetButtonEntity 创建自复位按钮实体
func CreateSelfResetButtonEntity(w ecs.World, buttonId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.ButtonStateComponent, system.ButtonSelfRestTag)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: buttonId})
system.ButtonStateComponent.Set(e, system.NewButtonState())
system.ButtonSelfRestTag.Set(e, &system.ButtonSelfRestState{KeepAxTime: 0})
return e
}
// CreateNonResetButtonEntity 创建非自复位按钮实体
func CreateNonResetButtonEntity(w ecs.World, buttonId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.ButtonStateComponent, system.ButtonNonRestTag)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: buttonId})
system.ButtonStateComponent.Set(e, system.NewButtonState())
return e
}