public void IsValidMoveTrueTest() { Disc[,] board = "----\n-OX-\n-XO-\n----".BoardFromString(); Assert.IsTrue(ReversiGame.IsValidMove(board, new Point(0, 1), Disc.White)); Assert.IsTrue(ReversiGame.IsValidMove(board, new Point(1, 3), Disc.Black)); Assert.IsTrue(ReversiGame.IsValidMove(board, new Point(3, 1), Disc.Black)); }
private Player SetOwnerOrCandidate(ReversiGame game) { if (game.Board[position] != null) { return(game.Board[position]); } else if (game.IsValidMove(position)) { return(game.CurrentPlayer); } else { return(null); } }