Packages

class King extends ChessPiece

Linear Supertypes
ChessPiece, Cloneable, Piece, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. King
  2. ChessPiece
  3. Cloneable
  4. Piece
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new King(name: String, x: Int, y: Int, color: Int)

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 canEat(board: Array[Array[Piece]], atkRow: Int, atkCol: Int): Boolean

    Returns true if the current piece can eat the attacked piece.

    Returns true if the current piece can eat the attacked piece.

    board

    the game board which has been played so far.

    atkRow

    the row of attacked cell.

    atkCol

    the column of attacked cell.

    returns

    true if the current piece can eat the attacked piece.

    Definition Classes
    ChessPiece
  6. var checked: Boolean
    Definition Classes
    ChessPiece
  7. def clear(): Unit

    Clears the moves array.

    Clears the moves array.

    Attributes
    protected
    Definition Classes
    ChessPiece
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  9. val color: Int
    Definition Classes
    Piece
  10. var curCol: Int
    Definition Classes
    Piece
  11. var curRow: Int
    Definition Classes
    Piece
  12. val dx: Array[Int]
    Definition Classes
    KingChessPiece
  13. val dy: Array[Int]
    Definition Classes
    KingChessPiece
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  16. var evaluationMatrix: Array[Array[Double]]
    Definition Classes
    KingChessPiece
  17. var firstMove: Boolean
    Definition Classes
    ChessPiece
  18. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  20. var image: ImageView
    Definition Classes
    Piece
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. def loadImage(): Unit

    Loads the image of the piece to the GUI board.

    Loads the image of the piece to the GUI board.

    Definition Classes
    ChessPiece
  23. def loopTemplate(board: Array[Array[Piece]], newX: Int, newY: Int, execute: (State) => Boolean, e: Int): Moves

    Returns a moves object and it depends on the execute function so it will return object holds all the valid moves or if the new move was valid or not.

    Returns a moves object and it depends on the execute function so it will return object holds all the valid moves or if the new move was valid or not.

    board

    the game board which has been played so far.

    newX

    the new row the piece will go to it.

    newY

    the new column the piece will go to it.

    execute

    a function that returns true if the game engine checks if the new move is valid, returns false otherwise. Also it returns false if the game needs all valid moves so it continues to loop on all valid moves.

    e

    end index for the piece.

    returns

    Returns a moves object.

    Attributes
    protected
    Definition Classes
    ChessPiece
  24. var moves: Moves
    Definition Classes
    ChessPiece
  25. var name: String
    Definition Classes
    Piece
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  29. var rank: Int
    Definition Classes
    KingChessPiece
  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. def validateMove(board: Array[Array[Piece]], newX: Int, newY: Int): Boolean

    Returns true if the new move is valid.

    Returns true if the new move is valid.

    board

    the game board which has been played so far.

    newX

    the new row the piece will go to it.

    newY

    the new column the piece will go to it.

    returns

    true if the new move is valid.

    Definition Classes
    KingChessPiece
  33. def validateMoveImpl(s: State): Boolean

    Returns true if the new move is valid.

    Returns true if the new move is valid.

    s

    holds the piece's current state and next state.

    returns

    true if the new move is valid.

    Attributes
    protected
    Definition Classes
    ChessPiece
  34. def validatedMoves(board: Array[Array[Piece]]): Array[Pair[Int, Int]]

    Returns all the valid movements for this piece.

    Returns all the valid movements for this piece.

    board

    the game board which has been played so far.

    returns

    all the valid movements for this piece.

    Definition Classes
    KingChessPiece
  35. def validatedMovesImpl(s: State): Boolean

    Returns true if the new move is valid and add this move to the array of valid moves.

    Returns true if the new move is valid and add this move to the array of valid moves.

    s

    holds the piece's current state and next state.

    returns

    true if the new move is valid.

    Attributes
    protected
    Definition Classes
    ChessPiece
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  39. def wantCastle(oldCol: Int, newCol: Int): Boolean

    Returns true if the piece can castle.

    Returns true if the piece can castle.

    oldCol

    the king's old column to be castled.

    newCol

    the king's new column to be castled.

    returns

    true if the piece can castle.

    Definition Classes
    KingChessPiece
  40. def wantPromote(): Boolean

    Returns true if the piece can promote.

    Returns true if the piece can promote.

    returns

    true if the piece can promote.

    Definition Classes
    ChessPiece

Deprecated Value Members

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

Inherited from ChessPiece

Inherited from Cloneable

Inherited from Piece

Inherited from AnyRef

Inherited from Any

Ungrouped