Game.java

1
package g0803.bindingofshiba.model.game;
2
3
import g0803.bindingofshiba.Constants;
4
import g0803.bindingofshiba.map.DefaultMapProvider;
5
import g0803.bindingofshiba.math.Vec2D;
6
import g0803.bindingofshiba.model.game.elements.Player;
7
import g0803.bindingofshiba.model.game.room.Room;
8
9
public class Game {
10
11
    private final Player player;
12
    private Room currentRoom;
13
14
    public Game() {
15
        this.player =
16
                new Player(
17
                        new Vec2D(Constants.ROOM_WIDTH / 2D, Constants.ROOM_HEIGHT / 2D), 0, 40, 5);
18
        this.currentRoom = new DefaultMapProvider().getFirstRoom();
19
        //                new Room(
20
        //                        Constants.ROOM_WIDTH,
21
        //                        Constants.ROOM_HEIGHT,
22
        //                        Arrays.asList(
23
        //                                new Monster(new Vec2D(15, 40), 3, 1),
24
        //                                new Monster(new Vec2D(10, 50), 5, 2)),
25
        //                        List.of(new Obstacle(30, 15)));
26
        //
27
        //        Room room2 = new Room(Constants.ROOM_WIDTH, Constants.ROOM_HEIGHT, List.of(),
28
        // List.of());
29
        //        Door door = new Door(currentRoom, DoorPosition.TOP, room2, DoorPosition.BOTTOM);
30
        //        currentRoom.addDoor(door);
31
        //        room2.addDoor(door);
32
    }
33
34
    public Game(Player player, Room room) {
35
        this.player = player;
36
        this.currentRoom = room;
37
    }
38
39
    public Player getPlayer() {
40 1 1. getPlayer : replaced return value with null for g0803/bindingofshiba/model/game/Game::getPlayer → KILLED
        return player;
41
    }
42
43
    public Room getCurrentRoom() {
44 1 1. getCurrentRoom : replaced return value with null for g0803/bindingofshiba/model/game/Game::getCurrentRoom → KILLED
        return currentRoom;
45
    }
46
47
    public void setCurrentRoom(Room currentRoom) {
48
        this.currentRoom = currentRoom;
49
    }
50
}

Mutations

40

1.1
Location : getPlayer
Killed by : g0803.bindingofshiba.controller.game.events.PlayerToWallCollisionEventsControllerTest.[engine:junit-jupiter]/[class:g0803.bindingofshiba.controller.game.events.PlayerToWallCollisionEventsControllerTest]/[method:playerNotCollidingWithWall()]
replaced return value with null for g0803/bindingofshiba/model/game/Game::getPlayer → KILLED

44

1.1
Location : getCurrentRoom
Killed by : g0803.bindingofshiba.controller.game.events.PlayerToObstacleCollisionEventsControllerTest.[engine:junit-jupiter]/[class:g0803.bindingofshiba.controller.game.events.PlayerToObstacleCollisionEventsControllerTest]/[method:playerNotCollidingWithObstacle()]
replaced return value with null for g0803/bindingofshiba/model/game/Game::getCurrentRoom → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.0