From 98407b35ff477f372baa92bf582b90a961d4ad16 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Wed, 27 Nov 2024 12:29:43 +0200 Subject: Added part of story & improved singing with multiple verses & hemingway distance --- src/scalevalapokalypsi/Model/Item.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/scalevalapokalypsi/Model/Item.scala') 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 -- cgit v1.2.3