道岔测试

This commit is contained in:
xzb 2023-08-25 13:26:23 +08:00
parent 747c9a2347
commit cd1ee45866
3 changed files with 6 additions and 5 deletions

View File

@ -34,7 +34,8 @@ func main() {
//
time.Sleep(2 * time.Second)
//
testPsdOpt(world)
//testPsdOpt(world)
testSwitchTurn(world)
//
time.Sleep(120 * time.Second)
}

View File

@ -19,9 +19,8 @@ func NewDebugSystem() *DebugSystem {
// world 执行
func (me *DebugSystem) Update(w ecs.World) {
//debugMovableDevice(w)
debugPsd(w)
//debugSwitch(w)
//debugPsd(w)
debugSwitch(w)
//debugSignal(w)
//debugTowPosButton(w)
}

View File

@ -27,7 +27,8 @@ const (
func (me *PercentageDeviceSystem) Update(world ecs.World) {
me.query.Each(world, func(e *ecs.Entry) {
percentage := components.PercentageDeviceStateComponent.Get(e)
if percentage.Rate != percentage.Target {
movable := components.MovableDeviceStateComponent.Get(e)
if percentage.Rate != percentage.Target || movable.Speed > 0 {
movable := components.MovableDeviceStateComponent.Get(e)
if movable.ToH {
if movable.Position >= percentage.Target {