blob: 30101c544a6b0113e4703973bc7868c4ddf2ba5c (
plain)
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
|
package scalevalapokalypsi.Client
/** `Turn`s represent information the client has got about a turn.
* This class exists essentially so that the client has somewhere
* to store data about turns and something to format that data with.
*/
class Turn:
/** Description of the area the player controlled by the client is in
* at the end of the turn. */
var areaDescription: String = ""
/** Directions the player controlled by the client can go to. */
var possibleDirections: Array[String] = Array.empty
/** Items the player controlled by the client can see. */
var visibleItems: Array[String] = Array.empty
/** Entities the player controlled by the client can see. */
var visibleEntities: Array[String] = Array.empty
override def toString: String =
val itemDesc = "You can see the following items: " +
this.visibleItems.mkString(", ")
val entityDesc = "The following entities reside in the room: " +
this.visibleEntities.mkString(", ")
val directionDesc = "There are exits to " +
this.possibleDirections.mkString(", ")
(s"$areaDescription\n$directionDesc\n" +
s"\n$itemDesc\n$entityDesc")
end Turn
|