aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Client/Turn.scala
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-17 13:45:44 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-17 13:45:44 +0200
commit4de67b497e0e229fe4a42f66f833640b6e50fd5a (patch)
tree34fb5b0e776f7cd3adcb4556f4d6a7c8ad66de39 /src/scalevalapokalypsi/Client/Turn.scala
parent8595e892abc0e0554f589ed2eb88c351a347fbd4 (diff)
downloadscalevalapokalypsi-4de67b497e0e229fe4a42f66f833640b6e50fd5a.tar.gz
scalevalapokalypsi-4de67b497e0e229fe4a42f66f833640b6e50fd5a.zip
Moved the project to an IDEA project & wrote part of README.txt
Diffstat (limited to 'src/scalevalapokalypsi/Client/Turn.scala')
-rw-r--r--src/scalevalapokalypsi/Client/Turn.scala32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/scalevalapokalypsi/Client/Turn.scala b/src/scalevalapokalypsi/Client/Turn.scala
new file mode 100644
index 0000000..30101c5
--- /dev/null
+++ b/src/scalevalapokalypsi/Client/Turn.scala
@@ -0,0 +1,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