flutter: putPiece 参数改为 (var pt, int sq)
This commit is contained in:
parent
2ecff8881a
commit
caa0d28560
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue