瀏覽代碼

Fix method not found in Checkers

Vsevolod Levitan 10 月之前
父節點
當前提交
ec1840aced
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Checkers/Checkers/CheckerBoard.cpp

+ 2 - 2
Checkers/Checkers/CheckerBoard.cpp

@@ -32,10 +32,10 @@ CheckerBoard CheckerBoard::loadFromFile(string filename)
         {
             // If the checker position starts with M (which marks a king), skip the first character of the position and create a king
             if (line[0] == 'M')
-                board.placeChecker(CheckerPosition(line.substr(1, 2)), color == WHITE ? CheckerPiece::WHITE_KING : CheckerPiece::BLACK_KING);
+                board.setCheckerAt(CheckerPosition(line.substr(1, 2)), color == WHITE ? CheckerPiece::WHITE_KING : CheckerPiece::BLACK_KING);
             // otherwise, use full position string and create a regular checker
             else
-                board.placeChecker(CheckerPosition(line), color == WHITE ? CheckerPiece::WHITE : CheckerPiece::BLACK);
+                board.setCheckerAt(CheckerPosition(line), color == WHITE ? CheckerPiece::WHITE : CheckerPiece::BLACK);
         }
     }
     file.close();