aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Model/Item.scala
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-27 12:29:43 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-27 12:29:43 +0200
commit98407b35ff477f372baa92bf582b90a961d4ad16 (patch)
treebb58925090075d1e9e30dd1593547db2cbe03bb6 /src/scalevalapokalypsi/Model/Item.scala
parent38900e0b291d5e0f59afaaa239cd237f733b6588 (diff)
downloadscalevalapokalypsi-98407b35ff477f372baa92bf582b90a961d4ad16.tar.gz
scalevalapokalypsi-98407b35ff477f372baa92bf582b90a961d4ad16.zip
Added part of story & improved singing with multiple verses & hemingway distance
Diffstat (limited to 'src/scalevalapokalypsi/Model/Item.scala')
-rw-r--r--src/scalevalapokalypsi/Model/Item.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/scalevalapokalypsi/Model/Item.scala b/src/scalevalapokalypsi/Model/Item.scala
index cccb489..eea7044 100644
--- a/src/scalevalapokalypsi/Model/Item.scala
+++ b/src/scalevalapokalypsi/Model/Item.scala
@@ -1,5 +1,6 @@
package scalevalapokalypsi.Model
+import scalevalapokalypsi.Model.Entities.Entity
import scala.annotation.targetName
/** The class `Item` represents items in a text adventure game. Each item has a
@@ -13,8 +14,11 @@ class Item(val name: String, val description: String, val weight: Int):
/** Returns a short textual representation of the item (its name, that is). */
override def toString = this.name
-
-
+
+ /** Makes the caller entity use this Item. Default implementation
+ * does nothing, this can be implemented by extending.
+ */
+ def use(caller: Entity): Option[Event] = None
end Item