diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-18 02:01:12 +0200 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-18 02:01:12 +0200 |
commit | fe2543627bcec1ea0f7a429bede20ca293458ba9 (patch) | |
tree | 42c9630d65292c90bee37444fde14fcf99cc3ffe /src/scalevalapokalypsi/Model/Adventure.scala | |
parent | a98f089035dbcc94c14c9cd6246c3150bee84241 (diff) | |
download | scalevalapokalypsi-fe2543627bcec1ea0f7a429bede20ca293458ba9.tar.gz scalevalapokalypsi-fe2543627bcec1ea0f7a429bede20ca293458ba9.zip |
Major change! Changed Events to have multiple first persons & changed sending action results to clients using this. This improves code and made it easy to finally make arrival/leaving messages when going from one area to another!
This commit is too big indeed, and there are probably bugs. I'm annoyed we didn't set up unit testing during the course. I should've taken my time to set up IDEA myself for that. Now the bugs will just have to be fixed in future commits.
Diffstat (limited to 'src/scalevalapokalypsi/Model/Adventure.scala')
-rw-r--r-- | src/scalevalapokalypsi/Model/Adventure.scala | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/scalevalapokalypsi/Model/Adventure.scala b/src/scalevalapokalypsi/Model/Adventure.scala index 0fbf6cd..9347bfa 100644 --- a/src/scalevalapokalypsi/Model/Adventure.scala +++ b/src/scalevalapokalypsi/Model/Adventure.scala @@ -66,16 +66,5 @@ class Adventure(val playerNames: Vector[String]): def getEntity[A >: Entity](name: String) = this.players.getOrElse(name, this.entities.get(name)) - /** Returns a message that is to be displayed to the player at the beginning of the game. */ - def welcomeMessage = "Generic welcome message" - - /** Plays a turn by executing the given in-game command, such as “go west”. Returns a textual - * report of what happened, or an error message if the command was unknown. In the latter - * case, no turns elapse. */ - def playTurnOfPlayer(playerName: String, command: String): Option[String] = - val action = Action(command) - val actor = this.players.get(playerName) - actor.flatMap(action.execute(_)) - end Adventure |