25 lines
595 B
Go
25 lines
595 B
Go
package iscs_sys
|
|
|
|
import (
|
|
"joylink.club/ecs"
|
|
"joylink.club/ecs/filter"
|
|
"joylink.club/rtsssimulation/component"
|
|
)
|
|
|
|
type WireCabinetSystem struct {
|
|
query *ecs.Query
|
|
}
|
|
|
|
func NewWireCabinetSystem() *WireCabinetSystem {
|
|
return &WireCabinetSystem{
|
|
query: ecs.NewQuery(filter.Contains(component.UidType, component.WireCabinetType, component.DeviceExceptionType)),
|
|
}
|
|
}
|
|
func (s *WireCabinetSystem) Update(w ecs.World) {
|
|
s.query.Each(w, func(entry *ecs.Entry) {
|
|
wc := component.WireCabinetType.Get(entry)
|
|
de := component.DeviceExceptionType.Get(entry)
|
|
wc.Normal = de.Exception.Non()
|
|
})
|
|
}
|