Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package battleship.utils.io
import battleship.core.models.{Player, Ship}
object PlayerDisplay {
def sunk(name: String): Unit = {
println(name.toUpperCase() + " SUNK !!! Well done !")
}
def touched(): Unit = {
println("HIT !")
}
def notTouched(): Unit = {
println("Not hit, too bad...")
}
def shoot(): Unit = {
println("Choose your target (example: A3) ->")
}
def problemPlacingShip(ship: Ship): Unit = {
println(s"Problem placing the ${ship.name}")
}
def placeYourShips(namePlayer: String): Unit = {
println(s"${namePlayer}")
}
def getOriginShip(nameShip: String, sizeShip: Int): Unit = {
println("What is the origin of your ship (example: A3) ->")
}
def setNewShip(nameShip: String, sizeShip: Int): Unit = {
println("You have to place the " + nameShip + " -> which is composed of " + sizeShip + " units:\n" +
"Will it be horizontal (" + Ship.HORIZONTAL + ") or vertical (" + Ship.VERTICAL + ") ?")
}
def show(player: Player, opponent: Player): Unit = {
println(s"${player.name} it is your turn ->")
}
}