ChessboardController class
Constructors
- ChessboardController({MoveCallback? onMove, DrawCallback? onDraw, CheckCallback? onCheck, CheckMateCallback? onCheckMate, ResignCallback? onResign, OfferDrawCallback? onOfferDraw, bool? enableMoves, bool? whiteSideTowardUser, bool? isUserWhite, String? startingPosition})
Properties
- board → ChessboardModel
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isUserWhite → bool?
-
no setter
- logic → Chess
-
no setter
- moveHistoryNotifier → MoveHistoryNotifier
-
no setter
- movesEnable → bool
-
no setter
- onCheck ↔ CheckCallback?
-
getter/setter pair
- onCheckMate ↔ CheckMateCallback?
-
getter/setter pair
- onDraw ↔ DrawCallback?
-
getter/setter pair
- onMove ↔ MoveCallback?
-
callbacks
getter/setter pair
- onOfferDraw ↔ OfferDrawCallback?
-
getter/setter pair
- onResign ↔ ResignCallback?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- whiteTowardUser → bool
-
no setter
Methods
-
buildBoard(
) → void - build the board according to the logic state
-
getSanHistory(
) → List< String> - get history of moves from logic
-
getSquareNotifier(
String squareName) → SquareNotifier -
getVerboseHistory(
) → List< Map> - Get history of game (moves) with details for each move. Returns a List
-
makeMoveWithoutCallback(
String move) → bool - make move without calling the controller callbacks. Others make move methods, call refreshBoard at the end, triggering callbacks
-
makePrettyMove(
Map< String, String> move) → bool - Attempt to make a move in the board if successfully made the move, return true and update the respective squares, otherwise return false.
-
makeSanMove(
String move) → bool - returns true if successfully make the move otherwise false
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshBoard(
) → void - use refreshBoard to force controller callbacks to run, for example onMove, onCheck...
-
toString(
) → String -
A string representation of this object.
inherited
-
undoMove(
) → void - undo a logical move and updates the board
-
updateSquare(
String squareName) → dynamic - update state of a specific square provided its squareName and the state from the logic.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited