abstract class ChessPiece extends Piece with Cloneable
- Alphabetic
- By Inheritance
- ChessPiece
- Cloneable
- Piece
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ChessPiece(pieceName: String, row: Int, col: Int, color: Int)
Abstract Value Members
- abstract val dx: Array[Int]
- abstract val dy: Array[Int]
- abstract val evaluationMatrix: Array[Array[Double]]
- abstract val rank: Int
- 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.
- 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
- 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
- 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.
- var checked: Boolean
- def clear(): Unit
Clears the moves array.
Clears the moves array.
- Attributes
- protected
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- val color: Int
- Definition Classes
- Piece
- var curCol: Int
- Definition Classes
- Piece
- var curRow: Int
- Definition Classes
- Piece
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- var firstMove: Boolean
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- var image: ImageView
- Definition Classes
- Piece
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def loadImage(): Unit
Loads the image of the piece to the GUI board.
- 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
- var moves: Moves
- var name: String
- Definition Classes
- Piece
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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
- 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
- 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])
- 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.
- 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
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated