From de1b7607d4d455a0ed734971974fc14ff4e753f7 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 8 Nov 2020 20:16:31 +0800 Subject: [PATCH] =?UTF-8?q?flutter:=20position=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/flutter/lib/mill/position.dart | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/ui/flutter/lib/mill/position.dart b/src/ui/flutter/lib/mill/position.dart index 02f56192..054cf674 100644 --- a/src/ui/flutter/lib/mill/position.dart +++ b/src/ui/flutter/lib/mill/position.dart @@ -37,15 +37,10 @@ class StateInfo { class Position { GameResult result = GameResult.pending; - String _sideToMove = Color.black; + List _board = List(49); // 7 * 7 MillRecorder _recorder; - int rule50 = 0; - int pliesFromNull = 0; - - Phase phase = Phase.none; - Action action = Action.none; int pieceCountInHandBlack = 12; int pieceCountInHandWhite = 12; int pieceCountOnBoardBlack = 0; @@ -53,6 +48,10 @@ class Position { int pieceCountNeedRemove = 0; int gamePly = 0; + String _sideToMove = Color.black; + + int rule50 = 0; + int pliesFromNull = 0; StateInfo st; @@ -60,6 +59,18 @@ class Position { String winner; GameOverReason gameOverReason = GameOverReason.noReason; + Phase phase = Phase.none; + Action action = Action.none; + + int scoreBlack = 0; + int scoreWhite = 0; + int scoreDraw = 0; + + int currentSquare; + int nPlayed = 0; + + //Move move; + Position.init() { for (var i = 0; i < _board.length; i++) { _board[i] ??= Piece.noPiece;