rts-sim-module/entities/dcb_entity.go
2023-09-27 15:34:39 +08:00

15 lines
459 B
Go

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
}