rts-sim-module/entity/platform.go

23 lines
455 B
Go
Raw Normal View History

package entity
import (
"joylink.club/ecs"
"joylink.club/rtsssimulation/repository"
)
func LoadPlatform(w ecs.World) error {
wd := GetWorldData(w)
for _, platform := range wd.Repo.PlatformList() {
for _, group := range platform.ComponentGroups() {
for _, component := range group.Components() {
relay, ok := component.(*repository.Relay)
if !ok {
continue
}
NewRelayEntity(w, relay, wd.EntityMap)
}
}
}
return nil
}