object ChessController extends Controller
- Alphabetic
- By Inheritance
- ChessController
- Controller
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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 checkEndGame(gameBoard: Array[Array[Piece]], turn: Int): Boolean
Returns ture if the game has ended.
Returns ture if the game has ended.
- gameBoard
the game board which has been played so far.
- turn
identifies who will play.
- returns
ture if the game has ended.
- Definition Classes
- ChessController → Controller
- def checkMate(gameBoard: Array[Array[Piece]], turn: Int, r: Int = -1, c: Int = -1): Boolean
Returns a boolean which indicates if the king of the specific player is in a check-mate.
Returns a boolean which indicates if the king of the specific player is in a check-mate.
- gameBoard
the game board of the current game.
- turn
the color of the specific player.
- r
for castling purpose only, we pass this parameter if we want to check for neighboring cells of the king is in check-mate.
- c
for castling purpose only, we pass this parameter if we want to check for neighboring cells of the king is in check-mate.
- returns
true if the king of the specific player is in check-mate and false otherwise.
- def checkTie(gameBoard: Array[Array[Piece]], turn: Int): Boolean
Returns ture if the game has ended as tie.
Returns ture if the game has ended as tie.
- gameBoard
the game board which has been played so far.
- turn
identifies who will play.
- returns
ture if the game has ended as tie.
- Definition Classes
- ChessController → Controller
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def createState(gameBoard: Array[Array[Piece]], modifiedPiece: Piece, newX: Int, newY: Int): Piece
Returns a piece object if a piece is removed.
Returns a piece object if a piece is removed.
- gameBoard
the game board which has been played so far.
- modifiedPiece
the piece which will move.
- newX
the new x coordinate for the piece.
- newY
the new y coordinate for the piece.
- returns
a piece object if a piece is removed, null otherwise.
- Definition Classes
- Controller
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def findKing(gameBoard: Array[Array[Piece]], turn: Int): ChessPiece
Returns the king piece for a specific player in the given board.
Returns the king piece for a specific player in the given board.
- gameBoard
the board which we want to search for the king in.
- turn
the color of the desired king wither it is white or black.
- returns
the king piece that we are searching for.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def getPlayerPieces(color: Int): Pair[Int, Int]
Returns the rows where the player's pieces lie.
Returns the rows where the player's pieces lie.
- color
color of the player's pieces.
- returns
the rows where the player's pieces lie.
- def getRookPlace(move: State): Pair[Int, Int]
Returns the rook old column and new column that the king will castle with it.
Returns the rook old column and new column that the king will castle with it.
- move
the game board which has been played so far.
- returns
the rook old column and new column.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def kingCastling(gameBoard: Array[Array[Piece]], move: State): Int
Returns the rook new column that the king castled with it.
Returns the rook new column that the king castled with it.
- gameBoard
the game board which has been played so far.
- move
the game board which has been played so far.
- returns
the rook new column.
- def movementValidation(gameBoard: Array[Array[Piece]], state: State): MoveValidation
Returns an object that holds two values the whole state and true if the move is valid.
Returns an object that holds two values the whole state and true if the move is valid.
- gameBoard
the game board which has been played so far.
- state
object that holds the current state (if exists) and the new state.
- returns
an object that holds a state and true if the move is valid.
- Definition Classes
- ChessController → Controller
- 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()
- def restoreState(gameBoard: Array[Array[Piece]], modifiedPiece: Piece, removedPiece: Piece, state: State): Unit
Restores the board to its previous state.
Restores the board to its previous state.
- gameBoard
the game board which has been played so far.
- modifiedPiece
the piece that will return to its previous state.
- removedPiece
a removed piece that will return to its previous state (if exists).
- state
object that holds the current state (if exists) and the new state.
- Definition Classes
- Controller
- 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