GameOverView.java

1
package g0803.bindingofshiba.view.end;
2
3
import g0803.bindingofshiba.App;
4
import g0803.bindingofshiba.Constants;
5
import g0803.bindingofshiba.events.IEventManager;
6
import g0803.bindingofshiba.gui.GUI;
7
import g0803.bindingofshiba.math.Vec2D;
8
import g0803.bindingofshiba.model.end.GameOver;
9
import g0803.bindingofshiba.textures.ITexture;
10
import g0803.bindingofshiba.textures.TextTextureBuilder;
11
import g0803.bindingofshiba.view.View;
12
import java.awt.*;
13
14
public class GameOverView extends View<GameOver> {
15
16
    public GameOverView(GameOver model, IEventManager eventManager) {
17
        super(model, eventManager);
18
    }
19
20
    @Override
21
    public void draw(App app, GUI gui, Vec2D offset) {
22 1 1. draw : removed call to g0803/bindingofshiba/gui/GUI::fill → NO_COVERAGE
        gui.fill(Color.darkGray);
23
24
        ITexture texture =
25
                new TextTextureBuilder(app.getFonts().get("text"))
26 1 1. draw : negated conditional → NO_COVERAGE
                        .setText(getModel().isVictory() ? "You won!" : "You lost!")
27
                        .setColor(Color.white)
28
                        .build();
29
30 1 1. draw : removed call to g0803/bindingofshiba/gui/GUI::blit → NO_COVERAGE
        gui.blit(
31 2 1. draw : Replaced integer division with multiplication → NO_COVERAGE
2. draw : Replaced integer subtraction with addition → NO_COVERAGE
                Constants.SCREEN_WIDTH / 2 - texture.getWidth() / 2,
32
                Constants.SCREEN_HEIGHT / 2,
33
                texture);
34
    }
35
}

Mutations

22

1.1
Location : draw
Killed by : none
removed call to g0803/bindingofshiba/gui/GUI::fill → NO_COVERAGE

26

1.1
Location : draw
Killed by : none
negated conditional → NO_COVERAGE

30

1.1
Location : draw
Killed by : none
removed call to g0803/bindingofshiba/gui/GUI::blit → NO_COVERAGE

31

1.1
Location : draw
Killed by : none
Replaced integer division with multiplication → NO_COVERAGE

2.2
Location : draw
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.7.0