flutter: putPiece 参数改为 (var pt, int sq)

This commit is contained in:
Calcitem 2020-11-15 09:33:30 +08:00
parent 2ecff8881a
commit caa0d28560
2 changed files with 3 additions and 3 deletions

View File

@ -171,8 +171,8 @@ class Position {
return selectPieceSQ(makeSquare(file, rank));
}
bool putPiece(var pt, int index) {
var sq = indexToSquare[index];
bool putPiece(var pt, int sq) {
var index = squareToIndex[sq];
if (sq == null) {
print("putPiece skip index: $index");

View File

@ -73,7 +73,7 @@ class _BattlePageState extends State<BattlePage> {
//position
//flag++;
//position.putPiece(flag % 2 == 0 ? '@' : 'O', index);
if (position.putPiece('@', index) == false) {
if (position.putPiece('@', indexToSquare[index]) == false) {
return;
}