diff options
Diffstat (limited to 'src/scalevalapokalypsi/Model/Item.scala')
-rw-r--r-- | src/scalevalapokalypsi/Model/Item.scala | 8 |
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 |