1 | package g0803.bindingofshiba.state; | |
2 | ||
3 | import g0803.bindingofshiba.App; | |
4 | import g0803.bindingofshiba.Constants; | |
5 | import g0803.bindingofshiba.controller.Controller; | |
6 | import g0803.bindingofshiba.gui.GUI; | |
7 | import g0803.bindingofshiba.math.Vec2D; | |
8 | import g0803.bindingofshiba.view.View; | |
9 | import java.io.IOException; | |
10 | ||
11 | public class State<T> { | |
12 | ||
13 | private final T model; | |
14 | private final Controller<T> controller; | |
15 | private final View<T> view; | |
16 | ||
17 | public State(T model, Controller<T> controller, View<T> view) { | |
18 | assert model != null && controller != null && view != null; | |
19 | assert controller.getModel() == model; | |
20 | assert view.getModel() == model; | |
21 | ||
22 | this.model = model; | |
23 | this.controller = controller; | |
24 | this.view = view; | |
25 | } | |
26 | ||
27 | public T getModel() { | |
28 |
1
1. getModel : replaced return value with null for g0803/bindingofshiba/state/State::getModel → NO_COVERAGE |
return model; |
29 | } | |
30 | ||
31 | public Controller<T> getController() { | |
32 |
1
1. getController : replaced return value with null for g0803/bindingofshiba/state/State::getController → NO_COVERAGE |
return controller; |
33 | } | |
34 | ||
35 | public View<T> getView() { | |
36 |
1
1. getView : replaced return value with null for g0803/bindingofshiba/state/State::getView → NO_COVERAGE |
return view; |
37 | } | |
38 | ||
39 | public void step(App app, GUI gui) throws IOException { | |
40 |
1
1. step : removed call to g0803/bindingofshiba/controller/Controller::tick → KILLED |
this.controller.tick(app, 1D / Constants.FPS); |
41 | ||
42 |
1
1. step : removed call to g0803/bindingofshiba/gui/GUI::clear → KILLED |
gui.clear(); |
43 |
1
1. step : removed call to g0803/bindingofshiba/view/View::draw → KILLED |
this.view.draw(app, gui, Vec2D.zero()); |
44 |
1
1. step : removed call to g0803/bindingofshiba/gui/GUI::refresh → KILLED |
gui.refresh(); |
45 | } | |
46 | } | |
Mutations | ||
28 |
1.1 |
|
32 |
1.1 |
|
36 |
1.1 |
|
40 |
1.1 |
|
42 |
1.1 |
|
43 |
1.1 |
|
44 |
1.1 |