Item

o1.adventure.Item
class Item(val name: String, val description: String)

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.

Parameters

description

the item’s description

name

the item’s name

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def toString: String

Returns a short textual representation of the item (its name, that is).

Returns a short textual representation of the item (its name, that is).

Attributes

Definition Classes
Any

Concrete fields

val name: String