瀏覽代碼

gamemachine runMatch

Dim Dim 6 年之前
父節點
當前提交
69507a86ea
共有 2 個文件被更改,包括 234 次插入227 次删除
  1. 227 227
      package-lock.json
  2. 7 0
      src/Game/game/machine/GameMachine.js

File diff suppressed because it is too large
+ 227 - 227
package-lock.json


+ 7 - 0
src/Game/game/machine/GameMachine.js

@@ -114,6 +114,13 @@ class GameMachine {
     ownerOf(x) {
         return this.state.board.owners[x];
     }
+
+    runMatch(stack) {
+        for (let i = 0; i < 9; i++) {
+            this.runMove(stack[i]);
+        }
+        return this.getWinner();
+    }
 }
 
 class Board {

Some files were not shown because too many files changed in this diff