aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/Model/Adventure.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/Model/Adventure.scala')
-rw-r--r--src/main/scala/Model/Adventure.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/scala/Model/Adventure.scala b/src/main/scala/Model/Adventure.scala
index 4d0a256..7d5a061 100644
--- a/src/main/scala/Model/Adventure.scala
+++ b/src/main/scala/Model/Adventure.scala
@@ -34,16 +34,18 @@ class Adventure(val playerNames: Vector[String]):
"Problem is, there's no battery."
))
- val players: Map[String, Entity] = Map()
+ val players: Map[String, Player] = Map()
playerNames.foreach(this.addPlayer(_))
+ val entities: Map[String, Entity] = Map()
+
/** Adds a player entity with the specified name to the game.
*
* @param name the name of the player entity to add
* @return the created player entity
*/
- def addPlayer(name: String): Entity =
- val newPlayer = Entity(name, middle)
+ def addPlayer(name: String): Player =
+ val newPlayer = Player(name, middle)
middle.addEntity(newPlayer)
players += name -> newPlayer
newPlayer
@@ -53,7 +55,7 @@ class Adventure(val playerNames: Vector[String]):
* @param name name of the player to find
* @return the player, if one with the name was found
*/
- def getPlayer(name: String): Option[Entity] = this.players.get(name)
+ def getPlayer(name: String): Option[Player] = this.players.get(name)
/** Returns a message that is to be displayed to the player at the beginning of the game. */
def welcomeMessage = "Generic welcome message"