From 4de67b497e0e229fe4a42f66f833640b6e50fd5a Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sun, 17 Nov 2024 13:45:44 +0200 Subject: Moved the project to an IDEA project & wrote part of README.txt --- src/scalevalapokalypsi/Model/Item.scala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/scalevalapokalypsi/Model/Item.scala (limited to 'src/scalevalapokalypsi/Model/Item.scala') diff --git a/src/scalevalapokalypsi/Model/Item.scala b/src/scalevalapokalypsi/Model/Item.scala new file mode 100644 index 0000000..7979480 --- /dev/null +++ b/src/scalevalapokalypsi/Model/Item.scala @@ -0,0 +1,20 @@ +package scalevalapokalypsi.Model + +import scala.annotation.targetName + +/** The class `Item` represents items in a text adventure game. Each item has a name + * and a longer description. (In later versions of the adventure game, items may + * have other features as well.) + * + * N.B. It is assumed, but not enforced by this class, that items have unique names. + * That is, no two items in a game world have the same name. + * + * @param name the item’s name + * @param description the item’s description */ +class Item(val name: String, val description: String): + + /** Returns a short textual representation of the item (its name, that is). */ + override def toString = this.name + +end Item + -- cgit v1.2.3