This commit is contained in:
weizhihong 2023-09-27 14:12:00 +08:00
commit 5833de36fb
2 changed files with 26 additions and 0 deletions

13
entities/emps_entity.go Normal file
View File

@ -0,0 +1,13 @@
package entities
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/system"
)
func CreateEmpsCircuitEntity(w ecs.World, empsCircuitId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.EmpsCircuitStateComponent)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: empsCircuitId})
system.EmpsCircuitStateComponent.Set(e, system.NewEmpsCircuitState())
return e
}

View File

@ -1 +1,14 @@
package entities
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/system"
)
// CreateSpksCircuitEntity 创建人员防护按钮电路实体
func CreateSpksCircuitEntity(w ecs.World, spksCircuitId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.SpksCircuitStateComponent)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: spksCircuitId})
system.SpksCircuitStateComponent.Set(e, system.NewSpksCircuitState())
return e
}