创建门控箱电路实体

This commit is contained in:
xzb 2023-09-27 15:34:39 +08:00
parent 471a44d8dc
commit 7bc8d247a4

14
entities/dcb_entity.go Normal file
View 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
}