public void Select(Location location) { if (selectingOrMoving == Selecting) { from = location; ActivateToSpaces(); } else { to = location; CurrentPlayer = !CurrentPlayer; MakeMove(); SyncWithGame(); Debug.Log(computerPlayerBool); //over is borken it;s not even firing if (game.Over() || game.Choices().Count == 0) { Debug.Log("winner!"); Debug.Log("hooman won"); SyncWithGame(); return; } else if (computerPlaying && CurrentPlayer == computerPlayerBool) { Move computerMove = game.PickOneForMe(); to = computerMove.to; from = computerMove.from; CurrentPlayer = !CurrentPlayer; MakeMove(); if (game.Choices().Count == 0) { Debug.Log("winner!"); Debug.Log("computer won"); SyncWithGame(); return; } SyncWithGame(); } } selectingOrMoving = !selectingOrMoving; }
public void ChessGameTestsSimplePasses() { SmartSquare[,] dumbSquares = SmartSquare.StandardBoardSetUp(); Decider game = new Decider(dumbSquares); int choices = game.Choices().Count; Debug.Log(choices); DeciderNode node = new DeciderNode(SmartSquare.StandardBoardSetUp()); node.SetMovesTo(); Debug.Log(node.to.Count); //TestPickOneForMe(); //PlayGame(10); }