(dt float32)
| 606 | } |
| 607 | |
| 608 | func (p *PauseSystem) Update(dt float32) { |
| 609 | if engo.Input.Button(pauseButton).JustPressed() { |
| 610 | if !p.paused { |
| 611 | for _, system := range p.world.Systems() { |
| 612 | switch sys := system.(type) { |
| 613 | case *common.AnimationSystem: |
| 614 | for _, ent := range p.entities { |
| 615 | sys.Remove(*ent.BasicEntity) |
| 616 | } |
| 617 | case *SpeedSystem: |
| 618 | for _, ent := range p.entities { |
| 619 | sys.Remove(*ent.BasicEntity) |
| 620 | } |
| 621 | case *ControlSystem: |
| 622 | for _, ent := range p.entities { |
| 623 | sys.Remove(*ent.BasicEntity) |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | } else { |
| 628 | for _, system := range p.world.Systems() { |
| 629 | switch sys := system.(type) { |
| 630 | case *common.AnimationSystem: |
| 631 | for _, ent := range p.entities { |
| 632 | if ent.AnimationComponent != nil { |
| 633 | sys.Add( |
| 634 | ent.BasicEntity, |
| 635 | ent.AnimationComponent, |
| 636 | ent.RenderComponent, |
| 637 | ) |
| 638 | } |
| 639 | } |
| 640 | case *SpeedSystem: |
| 641 | for _, ent := range p.entities { |
| 642 | if ent.SpeedComponent != nil { |
| 643 | sys.Add( |
| 644 | ent.BasicEntity, |
| 645 | ent.SpeedComponent, |
| 646 | ent.SpaceComponent, |
| 647 | ) |
| 648 | } |
| 649 | } |
| 650 | case *ControlSystem: |
| 651 | for _, ent := range p.entities { |
| 652 | if ent.ControlComponent != nil { |
| 653 | sys.Add( |
| 654 | ent.BasicEntity, |
| 655 | ent.AnimationComponent, |
| 656 | ent.ControlComponent, |
| 657 | ent.SpaceComponent, |
| 658 | ) |
| 659 | } |
| 660 | } |
| 661 | } |
| 662 | } |
| 663 | } |
| 664 | p.paused = !p.paused |
| 665 | } |
nothing calls this directly
no test coverage detected