package o1game.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