Packages

class Area extends AnyRef

The class Area represents locations in a text adventure game world. A game world consists of areas. In general, an "area" can be pretty much anything: a room, a building, an acre of forest, or something completely different. What different areas have in common is that players can be located in them and that they can have exits leading to other, neighboring areas. An area also has a name and a description.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Area
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Area(name: String, description: String)

    name

    the name of the area

    description

    a basic description of the area (typically not including information about items)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addItem(item: Item): Unit

    Places an item in the area so that it can be, for instance, picked up.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. def contains(itemName: String): Boolean

    Determines if the area contains an item of the given name.

  8. var description: String
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def fullDescription: String

    Returns a multi-line description of the area as a player sees it.

    Returns a multi-line description of the area as a player sees it. This includes a basic description of the area as well as information about exits and items. If there are no items present, the return value has the form "DESCRIPTION\n\nExits available: DIRECTIONS SEPARATED BY SPACES". If there are one or more items present, the return value has the form "DESCRIPTION\nYou see here: ITEMS SEPARATED BY SPACES\n\nExits available: DIRECTIONS SEPARATED BY SPACES".The items and directions are listed in an arbitrary order.

  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. var name: String
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def neighbor(direction: String): Option[Area]

    Returns the area that can be reached from this area by moving in the given direction.

    Returns the area that can be reached from this area by moving in the given direction. The result is returned in an Option; None is returned if there is no exit in the given direction.

  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def removeItem(itemName: String): Option[Item]

    Removes the item of the given name from the area, assuming an item with that name was there to begin with.

    Removes the item of the given name from the area, assuming an item with that name was there to begin with. Returns the removed item wrapped in an Option or None in the case there was no such item present.

  21. def setNeighbor(direction: String, neighbor: Area): Unit

    Adds an exit from this area to the given area.

    Adds an exit from this area to the given area. The neighboring area is reached by moving in the specified direction from this area.

  22. def setNeighbors(exits: Vector[(String, Area)]): Unit

    Adds exits from this area to the given areas.

    Adds exits from this area to the given areas. Calling this method is equivalent to calling the setNeighbor method on each of the given direction--area pairs.

    exits

    contains pairs consisting of a direction and the neighboring area in that direction

    See also

    setNeighbor

  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString: String

    Returns a single-line description of the area for debugging purposes.

    Returns a single-line description of the area for debugging purposes.

    Definition Classes
    Area → AnyRef → Any
  25. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped