diff options
author | Aleksi Heikkila <aleksi.e.heikkila@aalto.fi> | 2024-11-23 22:33:53 +0200 |
---|---|---|
committer | Aleksi Heikkila <aleksi.e.heikkila@aalto.fi> | 2024-11-23 22:33:53 +0200 |
commit | 27dd937617cce1e43df1c16e12050f6e88763d54 (patch) | |
tree | 8247736f7c4d5b1a0c1541c25f477e73e5783944 /src/scalevalapokalypsi/Model/Area.scala | |
parent | b11c02e8f1f4dea09847da999c2acb2f96df8a58 (diff) | |
parent | 28b83db50f33cb704311ffe608dcd8c4412635cf (diff) | |
download | scalevalapokalypsi-27dd937617cce1e43df1c16e12050f6e88763d54.tar.gz scalevalapokalypsi-27dd937617cce1e43df1c16e12050f6e88763d54.zip |
Merge branch 'master' of ssh://cron4.fi/~/O1-game
Diffstat (limited to 'src/scalevalapokalypsi/Model/Area.scala')
-rw-r--r-- | src/scalevalapokalypsi/Model/Area.scala | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/scalevalapokalypsi/Model/Area.scala b/src/scalevalapokalypsi/Model/Area.scala index 96392ba..c07f2f9 100644 --- a/src/scalevalapokalypsi/Model/Area.scala +++ b/src/scalevalapokalypsi/Model/Area.scala @@ -103,33 +103,6 @@ class Area(val name: String, var description: String): def removeEntity(entityName: String): Option[Entity] = this.entities.remove(entityName.toLowerCase()) - /** Returns a multi-line description of the area as a player sees it. This - * includes a basic description of the area as well as information about - * exits and items. If there are no items present, the return value has the - * form "DESCRIPTION\n\nExits available: - * DIRECTIONS SEPARATED BY SPACES". If there are one or more items present, - * the return value has the form "DESCRIPTION\nYou see here: ITEMS - * SEPARATED BY SPACES\n\nExits available: DIRECTIONS SEPARATED BY SPACES". - * The items and directions are listed in an arbitrary order. - */ - def fullDescription: String = - val exitList = this.neighbors.keys.mkString(" ") - val itemList = this.items.keys.mkString(" ") - val entityList = this.getEntityNames.mkString(" ") - val itemDescription = - if this.items.nonEmpty then - s"\nYou see here: ${itemList}" - else "" - val entityDescription = - if this.entities.nonEmpty then - s"\nThere are entities: ${entityList}" - else "" - (this.description + - itemDescription + - entityDescription + - s"\n\nExits available: $exitList") - - /** Returns a single-line description of the area for debugging purposes. */ override def toString = this.name + ": " + this.description.replaceAll("\n", " ").take(150) |