rts-sim-module/entities/signal_entity.go
2023-09-18 17:34:06 +08:00

46 lines
2.2 KiB
Go

package entities
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/system"
)
func CreateSignal3XH1Entity(w ecs.World, signalId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.Signal3XH1StateComponent, system.Signal3XH1FilamentStateComponent)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: signalId})
system.Signal3XH1StateComponent.Set(e, system.NewSignal3XH1State())
system.Signal3XH1FilamentStateComponent.Set(e, system.NewSignal3XH1FilamentState())
return e
}
func CreateSignal2XH1CdcEntity(w ecs.World, signalId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.Signal2XH1StateComponent, system.Signal2XH1FilamentStateComponent)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: signalId})
system.Signal2XH1StateComponent.Set(e, system.NewSignal2XH1CdcState())
system.Signal2XH1FilamentStateComponent.Set(e, system.NewSignal2XH1FilamentState())
return e
}
func CreateSignal2XH1CzqzEntity(w ecs.World, signalId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.Signal2XH1StateComponent, system.Signal2XH1FilamentStateComponent)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: signalId})
system.Signal2XH1StateComponent.Set(e, system.NewSignal2XH1CzqzState())
system.Signal2XH1FilamentStateComponent.Set(e, system.NewSignal2XH1FilamentState())
return e
}
func CreateSignal3XH2Entity(w ecs.World, signalId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.Signal3XH2StateComponent, system.Signal3XH2FilamentStateComponent)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: signalId})
system.Signal3XH2StateComponent.Set(e, system.NewSignal3XH2State())
system.Signal3XH2FilamentStateComponent.Set(e, system.NewSignal3XH2FilamentState())
return e
}
func CreateSignal3XH3Entity(w ecs.World, signalId string) *ecs.Entry {
e := w.Create(system.EntityIdentityComponent, system.Signal3XH3StateComponent, system.Signal3XH3FilamentStateComponent)
system.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: signalId})
system.Signal3XH3StateComponent.Set(e, system.NewSignal3XH3State())
system.Signal3XH3FilamentStateComponent.Set(e, system.NewSignal3XH3FilamentState())
return e
}