【修改ibp电路逻辑】
This commit is contained in:
parent
3582864835
commit
1798ee0a69
@ -8,26 +8,30 @@ import (
|
||||
|
||||
// ibp 系统
|
||||
type IBPSys struct {
|
||||
query *ecs.Query
|
||||
empQuery *ecs.Query
|
||||
spksQuery *ecs.Query
|
||||
}
|
||||
|
||||
// ibp盘系统
|
||||
func NewIBPSys() *IBPSys {
|
||||
return &IBPSys{
|
||||
query: ecs.NewQuery(filter.Contains(component.SpkElectronicType, component.EmpElectronicType)),
|
||||
empQuery: ecs.NewQuery(filter.Contains(component.EmpElectronicType)),
|
||||
spksQuery: ecs.NewQuery(filter.Contains(component.SpkElectronicType)),
|
||||
}
|
||||
}
|
||||
|
||||
// 控制电路更新
|
||||
func (ibp *IBPSys) Update(w ecs.World) {
|
||||
ibp.query.Each(w, func(entry *ecs.Entry) {
|
||||
spkState := component.SpkElectronicType.Get(entry)
|
||||
ibp.spkControl(entry, spkState)
|
||||
ibp.spksState(entry, spkState)
|
||||
ibp.empQuery.Each(w, func(entry *ecs.Entry) {
|
||||
empState := component.EmpElectronicType.Get(entry)
|
||||
ibp.empControl(entry, empState)
|
||||
ibp.empState(entry, empState)
|
||||
})
|
||||
ibp.spksQuery.Each(w, func(entry *ecs.Entry) {
|
||||
spkState := component.SpkElectronicType.Get(entry)
|
||||
ibp.spkControl(entry, spkState)
|
||||
ibp.spksState(entry, spkState)
|
||||
})
|
||||
}
|
||||
|
||||
// 人员防护继电器控制电路逻辑
|
||||
|
Loading…
Reference in New Issue
Block a user