Packages

c

o1.adventure

Adventure

class Adventure extends AnyRef

The class Adventure represents text adventure games. An adventure consists of a player and a number of areas that make up the game world. It provides methods for playing the game one turn at a time and for checking the state of the game.

N.B. This version of the class has a lot of "hard-coded" information which pertain to a very specific adventure game that involves a small trip through a twisted forest. All newly created instances of class Adventure are identical to each other. To create other kinds of adventure games, you will need to modify or replace the source code of this class.

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

Instance Constructors

  1. new Adventure()

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def goodbyeMessage: String

    Returns a message that is to be displayed to the player at the end of the game.

    Returns a message that is to be displayed to the player at the end of the game. The message will be different depending on whether or not the player has completed their quest.

  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  11. def isComplete: Boolean

    Determines if the adventure is complete, that is, if the player has won.

  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def isOver: Boolean

    Determines whether the player has won, lost, or quit, thereby ending the game.

  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def playTurn(command: String): String

    Plays a turn by executing the given in-game command, such as "go west".

    Plays a turn by executing the given in-game command, such as "go west". Returns a textual report of what happened, or an error message if the command was unknown. In the latter case, no turns elapse.

  18. val player: Player

    The character who is the protagonist of the adventure and whom the real-life player controls.

  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. val timeLimit: Int

    The maximum number of turns that this adventure game allows before time runs out.

  21. val title: String

    The title of the adventure game.

  22. def toString: String
    Definition Classes
    AnyRef → Any
  23. var turnCount: Int

    The number of turns that have passed since the start of the game.

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

    Returns a message that is to be displayed to the player at the beginning of the game.

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