创建门控箱电路实体
This commit is contained in:
parent
471a44d8dc
commit
7bc8d247a4
14
entities/dcb_entity.go
Normal file
14
entities/dcb_entity.go
Normal file
@ -0,0 +1,14 @@
|
||||
package entities
|
||||
|
||||
import (
|
||||
"joylink.club/ecs"
|
||||
"joylink.club/rtsssimulation/system"
|
||||
)
|
||||
|
||||
// CreateDcbCircuitEntity 创建门控箱电路实体
|
||||
func CreateDcbCircuitEntity(w ecs.World, dcbCircuitId string) *ecs.Entry {
|
||||
e := w.Create(system.EntityIdentityComponent, system.DcbCircuitStateComponent)
|
||||
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: dcbCircuitId})
|
||||
system.DcbCircuitStateComponent.Set(e, system.NewDcbCircuitState())
|
||||
return e
|
||||
}
|
Loading…
Reference in New Issue
Block a user