rts-sim-module/entities/signal_entity.go

14 lines
397 B
Go
Raw Normal View History

2023-09-13 10:05:42 +08:00
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.EntityIdentityComponent.Set(e, &system.EntityIdentity{Id: signalId})
system.Signal3XH1StateComponent.Set(e, system.NewSignal3XH1State())
return e
}