| 1 | package g0803.bindingofshiba.map; | |
| 2 | ||
| 3 | import g0803.bindingofshiba.Constants; | |
| 4 | import g0803.bindingofshiba.math.Vec2D; | |
| 5 | import g0803.bindingofshiba.model.game.elements.Monster; | |
| 6 | import g0803.bindingofshiba.model.game.elements.Obstacle; | |
| 7 | import g0803.bindingofshiba.model.game.room.Door; | |
| 8 | import g0803.bindingofshiba.model.game.room.DoorPosition; | |
| 9 | import g0803.bindingofshiba.model.game.room.LastRoom; | |
| 10 | import g0803.bindingofshiba.model.game.room.Room; | |
| 11 | import java.util.List; | |
| 12 | ||
| 13 | public class DefaultMapProvider implements MapProvider { | |
| 14 | ||
| 15 | @Override | |
| 16 | public Room getFirstRoom() { | |
| 17 | Room trollRoom = | |
| 18 | new Room( | |
| 19 | Constants.ROOM_WIDTH, | |
| 20 | Constants.ROOM_HEIGHT, | |
| 21 | null, | |
| 22 | List.of( | |
| 23 | new Obstacle(6, 7), | |
| 24 | new Obstacle(50, 55), | |
| 25 | new Obstacle(23, 44), | |
| 26 | new Obstacle(80, 25))); | |
| 27 | ||
| 28 | Room fightRoom = | |
| 29 | new Room( | |
| 30 | Constants.ROOM_WIDTH, | |
| 31 | Constants.ROOM_HEIGHT, | |
| 32 | List.of( | |
| 33 | new Monster(new Vec2D(128, 13), 20, 5), | |
| 34 | new Monster(new Vec2D(13, 13), 20, 5), | |
| 35 | new Monster(new Vec2D(90, 55), 20, 5)), | |
| 36 | List.of( | |
| 37 | new Obstacle(8, 21), | |
| 38 | new Obstacle(48, 13), | |
| 39 | new Obstacle(123, 45), | |
| 40 | new Obstacle(46, 32), | |
| 41 | new Obstacle(34, 54), | |
| 42 | new Obstacle(112, 11), | |
| 43 | new Obstacle(72, 61))); | |
| 44 | ||
| 45 | Door fightToTroll = new Door(fightRoom, DoorPosition.TOP, trollRoom, DoorPosition.BOTTOM); | |
| 46 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
fightRoom.addDoor(fightToTroll); |
| 47 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
trollRoom.addDoor(fightToTroll); |
| 48 | ||
| 49 | Room allMonsters = | |
| 50 | new Room( | |
| 51 | Constants.ROOM_WIDTH, | |
| 52 | Constants.ROOM_HEIGHT, | |
| 53 | List.of( | |
| 54 | new Monster(new Vec2D(15, 15), 20, 5), | |
| 55 | new Monster(new Vec2D(128, 15), 20, 5), | |
| 56 | new Monster(new Vec2D(15, 56), 20, 5), | |
| 57 | new Monster(new Vec2D(128, 56), 20, 5)), | |
| 58 | List.of( | |
| 59 | new Obstacle( | |
| 60 | new Vec2D( | |
| 61 | Constants.ROOM_WIDTH / 2D, | |
| 62 | Constants.ROOM_HEIGHT / 2D)))); | |
| 63 | ||
| 64 | Door trollToAllMonsters = | |
| 65 | new Door(trollRoom, DoorPosition.RIGHT, allMonsters, DoorPosition.LEFT); | |
| 66 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
trollRoom.addDoor(trollToAllMonsters); |
| 67 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
allMonsters.addDoor(trollToAllMonsters); |
| 68 | ||
| 69 | Door allMonstersToTroll = | |
| 70 | new Door(allMonsters, DoorPosition.BOTTOM, trollRoom, DoorPosition.TOP); | |
| 71 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
allMonsters.addDoor(allMonstersToTroll); |
| 72 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
trollRoom.addDoor(allMonstersToTroll); |
| 73 | ||
| 74 | Door allMonstersToFight = | |
| 75 | new Door(allMonsters, DoorPosition.TOP, fightRoom, DoorPosition.RIGHT); | |
| 76 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
allMonsters.addDoor(allMonstersToFight); |
| 77 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
fightRoom.addDoor(allMonstersToFight); |
| 78 | ||
| 79 | LastRoom lastRoom = new LastRoom(Constants.ROOM_WIDTH, Constants.ROOM_HEIGHT); | |
| 80 | ||
| 81 | Door toEnd = new Door(allMonsters, DoorPosition.RIGHT, lastRoom, DoorPosition.LEFT); | |
| 82 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/Room::addDoor → NO_COVERAGE |
allMonsters.addDoor(toEnd); |
| 83 |
1
1. getFirstRoom : removed call to g0803/bindingofshiba/model/game/room/LastRoom::addDoor → NO_COVERAGE |
lastRoom.addDoor(toEnd); |
| 84 | ||
| 85 |
1
1. getFirstRoom : replaced return value with null for g0803/bindingofshiba/map/DefaultMapProvider::getFirstRoom → NO_COVERAGE |
return fightRoom; |
| 86 | } | |
| 87 | } | |
Mutations | ||
| 46 |
1.1 |
|
| 47 |
1.1 |
|
| 66 |
1.1 |
|
| 67 |
1.1 |
|
| 71 |
1.1 |
|
| 72 |
1.1 |
|
| 76 |
1.1 |
|
| 77 |
1.1 |
|
| 82 |
1.1 |
|
| 83 |
1.1 |
|
| 85 |
1.1 |