Packages

class Glass extends AnyRef

The class Glass represents glasses in a game of Viinaharava. A glass object is mutable: it is initially full of water but can be modified to contain booze instead and can be emptied.

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

Instance Constructors

  1. new Glass(board: GameBoard, location: o1.GridPos)

    board

    the game board that the glass is located on

    location

    the location of the glass on the game board

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. val board: GameBoard
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  7. def dangerLevel: Int

    Returns the number of neighboring booze glasses (diagonals included).

    Returns the number of neighboring booze glasses (diagonals included).

    Note to students: This method only returns the danger level of the glass. It does NOT change the level; that is pourBooze’s job.

  8. def empty(): Boolean

    Empties the glass.

    Empties the glass. This just means that the glass is now empty instead of full. (If the glass was already empty, this method does nothing but return false.)

    returns

    true if the glass was full, false if it wasn’t

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def isBooze: Boolean

    Determines whether the glass is a glass of booze.

    Determines whether the glass is a glass of booze. A glass counts as a booze glass even if the booze has already been drunk.

  14. def isEmpty: Boolean

    Determines whether the glass is empty.

  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def isSafe: Boolean

    Determines whether the glass has a dangerLevel of zero.

  17. val location: o1.GridPos
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def neighbors: Vector[Glass]

    Returns this glass's neighboring glasses (diagonals included) on the game board.

  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def pourBooze(): Unit

    If the glass is a water glass (full or empty), turns it into a full booze glass.

    If the glass is a water glass (full or empty), turns it into a full booze glass. This raises the danger levels of neighboring glasses. If the glass was a booze glass (full or empty) to begin with, this method does nothing.

    See also

    dangerLevel

  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString: String
    Definition Classes
    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