spks emps

This commit is contained in:
xzb 2023-09-27 13:17:58 +08:00
parent 11a572e9c7
commit 9d4c0cf164
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
}