Packages

c

Chess.Pieces

ChessPiece

abstract class ChessPiece extends Piece with Cloneable

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

Instance Constructors

  1. new ChessPiece(pieceName: String, row: Int, col: Int, color: Int)

Abstract Value Members

  1. abstract val dx: Array[Int]
  2. abstract val dy: Array[Int]
  3. abstract val evaluationMatrix: Array[Array[Double]]
  4. abstract val rank: Int
  5. abstract 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.

  6. abstract 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.

Concrete 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.

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

    Clears the moves array.

    Clears the moves array.

    Attributes
    protected
  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. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. var firstMove: Boolean
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  17. var image: ImageView
    Definition Classes
    Piece
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def loadImage(): Unit

    Loads the image of the piece to the GUI board.

  20. 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
  21. var moves: Moves
  22. var name: String
    Definition Classes
    Piece
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. 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
  29. 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
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. 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.

  34. def wantPromote(): Boolean

    Returns true if the piece can promote.

    Returns true if the piece can promote.

    returns

    true if the piece can promote.

Deprecated Value Members

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

Inherited from Cloneable

Inherited from Piece

Inherited from AnyRef

Inherited from Any

Ungrouped