class Pawn extends ChessPiece
- Alphabetic
- By Inheritance
- Pawn
- ChessPiece
- Cloneable
- Piece
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Pawn(name: String, x: Int, y: Int, color: Int)
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.
- Definition Classes
- ChessPiece
- var checked: Boolean
- Definition Classes
- ChessPiece
- def clear(): Unit
Clears the moves array.
Clears the moves array.
- Attributes
- protected
- Definition Classes
- ChessPiece
- 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
- val dx: Array[Int]
- Definition Classes
- Pawn → ChessPiece
- val dy: Array[Int]
- Definition Classes
- Pawn → ChessPiece
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- var evaluationMatrix: Array[Array[Double]]
- Definition Classes
- Pawn → ChessPiece
- var firstMove: Boolean
- Definition Classes
- ChessPiece
- 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.
Loads the image of the piece to the GUI board.
- Definition Classes
- ChessPiece
- 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
- var moves: Moves
- Definition Classes
- ChessPiece
- 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()
- var promotedDone: Boolean
- var promotedMove: (Int, Int) => Boolean
- var rank: Int
- Definition Classes
- Pawn → ChessPiece
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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
- Pawn → ChessPiece
- 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
- 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
- Pawn → ChessPiece
- 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
- 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.
- Definition Classes
- ChessPiece
- 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
- Pawn → ChessPiece
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated