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.
- Alphabetic
- By Inheritance
- Glass
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- 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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val board: GameBoard
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- 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.
- 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
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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.
- def isEmpty: Boolean
Determines whether the glass is empty.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isSafe: Boolean
Determines whether the glass has a dangerLevel of zero.
- val location: o1.GridPos
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def neighbors: Vector[Glass]
Returns this glass's neighboring glasses (diagonals included) on the game board.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString: String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- 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.