package entities import ( "joylink.club/ecs" "joylink.club/rtsssimulation/system" ) // CreateRelayEntity 创建继电器实体 func CreateRelayEntity(w ecs.World, relayId string) *ecs.Entry { e := w.Create(system.EntityIdentityComponent, system.RelayStateComponent) system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: relayId}) system.RelayStateComponent.Set(e, system.NewRelayState()) return e }