parent
5096494372
commit
dfb5d47afc
|
@ -104,6 +104,24 @@ class Battle {
|
|||
//Audios.playTone('click.mp3');
|
||||
}
|
||||
|
||||
bool move(int from, int to) {
|
||||
//
|
||||
position.move(from, to);
|
||||
|
||||
_blurIndex = from;
|
||||
_focusIndex = to;
|
||||
|
||||
/*
|
||||
if (ChessRules.checked(position)) {
|
||||
//Audios.playTone('check.mp3');
|
||||
} else {
|
||||
//Audios.playTone(captured != Piece.Empty ? 'capture.mp3' : 'move.mp3');
|
||||
}
|
||||
*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool regret({steps = 2}) {
|
||||
//
|
||||
// 轮到自己走棋的时候,才能悔棋
|
||||
|
|
|
@ -194,8 +194,8 @@ class Position {
|
|||
}
|
||||
|
||||
bool movePiece(int fromSq, int toSq) {
|
||||
if (selectPieceSQ(fromSq)) {
|
||||
return putPieceSQ(toSq);
|
||||
if (selectPiece(fromSq)) {
|
||||
return putPiece(toSq);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -670,7 +670,8 @@ class Position {
|
|||
rule50++;
|
||||
|
||||
board[s] = _grid[squareToIndex[s]] = board[currentSquare];
|
||||
board[currentSquare] = _grid[squareToIndex[s]] = Piece.noPiece;
|
||||
board[currentSquare] =
|
||||
_grid[squareToIndex[currentSquare]] = Piece.noPiece;
|
||||
|
||||
currentSquare = s;
|
||||
int n = addMills(currentSquare);
|
||||
|
|
Loading…
Reference in New Issue