flutter: 删除或修改部分打印

This commit is contained in:
Calcitem 2020-12-06 19:07:24 +08:00
parent e8dbe2e2d3
commit fc429a9b47
4 changed files with 24 additions and 24 deletions

View File

@ -264,7 +264,7 @@ class Position {
// step counter
//ss += '${recorder?.halfMove ?? 0} ${recorder?.fullMove ?? 0}';
print("fen = " + ss);
//print("fen = " + ss);
return ss;
}
@ -306,7 +306,7 @@ class Position {
*/
bool ret = false;
print("position: command = $move");
//print("doMove $move");
if (move.length > "Player".length &&
move.substring(0, "Player".length - 1) == "Player") {
@ -578,7 +578,7 @@ class Position {
// not in moveTable
if (md == moveDirectionNumber) {
print("putPiece: [$s] is not in [$currentSquare]'s moveTable");
print("putPiece: [$s] is not in [$currentSquare]'s move table.");
return false;
}
}
@ -742,7 +742,7 @@ class Position {
}
bool checkGameOverCondition() {
print("Checking game over condition ...");
//print("Is game over?");
if (phase == Phase.ready || phase == Phase.gameOver) {
return true;
@ -752,7 +752,7 @@ class Position {
winner = Color.draw;
phase = Phase.gameOver;
gameOverReason = GameOverReason.drawReasonRule50;
print("Game over, draw, because of $gameOverReason");
print("Game over, draw, because of $gameOverReason.");
return true;
}
@ -768,7 +768,7 @@ class Position {
}
bool isNoWay = isAllSurrounded();
print("phase = $phase, action = $action, isAllSurrounded = $isNoWay");
//print("phase = $phase, action = $action, isAllSurrounded = $isNoWay");
if (phase == Phase.moving && action == Act.select && isNoWay) {
if (rule.isLoseButNotChangeSideWhenNoWay) {
setGameOver(
@ -776,12 +776,12 @@ class Position {
return true;
} else {
changeSideToMove(); // TODO: Need?
print("Game is not over");
//print("Game is not over");
return false;
}
}
print("Game is NOT over");
//print("Game is NOT over");
return false;
}
@ -1417,14 +1417,14 @@ class Position {
// Full
if (pieceCountOnBoard[Color.black] + pieceCountOnBoard[Color.white] >=
rankNumber * fileNumber) {
print("Board is full.");
//print("Board is full.");
return true;
}
// Can fly
if (pieceCountOnBoard[sideToMove()] <= rule.nPiecesAtLeast &&
rule.allowFlyWhenRemainThreePieces) {
print("Can fly.");
//print("Can fly.");
return false;
}
@ -1443,7 +1443,7 @@ class Position {
}
}
print("No way.");
//print("No way.");
return true;
}
@ -1500,7 +1500,7 @@ class Position {
String moves = "";
int posAfterLastRemove = 0;
print("recorder.movesCount = ${recorder.movesCount}");
//print("recorder.movesCount = ${recorder.movesCount}");
for (i = recorder.movesCount - 1; i >= 0; i--) {
//if (recorder.moveAt(i).type == MoveType.remove) break;
@ -1511,17 +1511,17 @@ class Position {
posAfterLastRemove = i + 1;
}
print("[movesSinceLastRemove] posAfterLastRemove = $posAfterLastRemove");
//print("[movesSinceLastRemove] posAfterLastRemove = $posAfterLastRemove");
for (int i = posAfterLastRemove; i < recorder.movesCount; i++) {
moves += " ${recorder.moveAt(i).move}";
}
print("moves = $moves");
//print("moves = $moves");
var idx = moves.indexOf('-(');
if (idx != -1) {
print("moves[$idx] is -(");
//print("moves[$idx] is -(");
assert(false);
}
@ -1535,7 +1535,7 @@ class Position {
void changeSideToMove() {
them = _sideToMove;
_sideToMove = Color.opponent(_sideToMove);
print("Change sideToMove to $_sideToMove");
print("$_sideToMove to move.");
}
get halfMove => recorder.halfMove;

View File

@ -138,7 +138,7 @@ class PiecesPainter extends PiecesBasePainter {
canvas.drawCircle(pps.pos, pieceInnerRadius, paint);
break;
case Piece.ban:
print("pps.piece is Ban");
//print("pps.piece is Ban");
break;
default:
assert(false);

View File

@ -80,13 +80,13 @@ class Board extends StatelessWidget {
final column = (dx - padding) ~/ squareWidth;
if (column < 0 || column > 6) {
print("Tap on column $column skip");
print("Tap on column $column (ignored).");
return;
}
final row = (dy - padding - digitsHeight) ~/ squareWidth;
if (row < 0 || row > 6) {
print("Tap on row $row skip");
print("Tap on row $row (ignored).");
return;
}

View File

@ -54,7 +54,7 @@ class _GamePageState extends State<GamePage> {
@override
void initState() {
print("engineType = ${widget.engineType}");
print("Engine type: ${widget.engineType}");
Game.shared.setWhoIsAi(widget.engineType);
@ -65,7 +65,7 @@ class _GamePageState extends State<GamePage> {
changeStatus(String status) {
if (context == null) {
print("[changeStatus] context == null, return");
//print("[changeStatus] context == null, return");
return;
}
@ -74,7 +74,7 @@ class _GamePageState extends State<GamePage> {
void showTips() {
if (context == null) {
print("[showTips] context == null, return");
//print("[showTips] context == null, return");
return;
}
@ -105,7 +105,7 @@ class _GamePageState extends State<GamePage> {
int sq = indexToSquare[index];
if (sq == null) {
print("putPiece skip index: $index");
//print("putPiece skip index: $index");
return;
}
@ -251,7 +251,7 @@ class _GamePageState extends State<GamePage> {
changeStatus(S.of(context).gameStarted);
if (Game.shared.isAiToMove()) {
print("New Game: AI's turn.");
print("New game, AI to move.");
engineToGo();
}
}