| 1 | package g0803.bindingofshiba.controller.game.events; | |
| 2 | ||
| 3 | import g0803.bindingofshiba.App; | |
| 4 | import g0803.bindingofshiba.controller.Controller; | |
| 5 | import g0803.bindingofshiba.events.IEventManager; | |
| 6 | import g0803.bindingofshiba.events.game.*; | |
| 7 | import g0803.bindingofshiba.model.game.Game; | |
| 8 | import java.util.Arrays; | |
| 9 | import java.util.List; | |
| 10 | ||
| 11 | public class CollisionEventsController extends Controller<Game> { | |
| 12 | ||
| 13 | private final List<? extends Controller<?>> controllers; | |
| 14 | ||
| 15 | public CollisionEventsController(Game model, IEventManager eventManager) { | |
| 16 | super(model, eventManager); | |
| 17 | ||
| 18 | this.controllers = | |
| 19 | Arrays.asList( | |
| 20 | new MonsterToMonsterCollisionEventsController(model, eventManager), | |
| 21 | new PlayerToMonsterCollisionEventsController(model, eventManager), | |
| 22 | new MonsterToWallsCollisionEventsController(model, eventManager), | |
| 23 | new PlayerToWallsCollisionEventsController(model, eventManager), | |
| 24 | new MonsterToObstacleCollisionEventsController(model, eventManager), | |
| 25 | new PlayerToObstacleCollisionEventsController(model, eventManager), | |
| 26 | new ProjectileToMonsterCollisionEventsController(model, eventManager), | |
| 27 | new ProjectileToStaticElementsCollisionEventsController( | |
| 28 | model, eventManager)); | |
| 29 | } | |
| 30 | ||
| 31 | public CollisionEventsController( | |
| 32 | Game model, IEventManager eventManager, List<? extends Controller<?>> controllers) { | |
| 33 | super(model, eventManager); | |
| 34 | ||
| 35 | this.controllers = controllers; | |
| 36 | } | |
| 37 | ||
| 38 | @Override | |
| 39 | public void tick(App app, double dt) { | |
| 40 |
1
1. tick : removed call to g0803/bindingofshiba/controller/Controller::tick → KILLED |
for (Controller<?> controller : controllers) controller.tick(app, dt); |
| 41 | } | |
| 42 | } | |
Mutations | ||
| 40 |
1.1 |