Added proprietary user interface.

Added most game logic.
This commit is contained in:
Michael Chen
2020-01-04 13:13:13 +01:00
committed by Michael Chen
parent 71c1a4d20c
commit 27f6efb58a
8 changed files with 369 additions and 58 deletions

View File

@ -1,26 +0,0 @@
namespace TicTacToe {
public class Grid {
private readonly Player[,] _field;
private const int GRIDSIZE = 3;
public bool GameOver => IsGameOver();
private bool IsGameOver() {
for (var x = 0; x < GRIDSIZE; x++)
for (var y = 0; y < GRIDSIZE; y++)
if (IsFieldEmpty(x, y))
return false;
return true;
}
private bool IsFieldEmpty(int x, int y) {
return _field[x, y] == Player.Empty;
}
public Grid() {
_field = new Player[GRIDSIZE, GRIDSIZE];
}
public bool PickSpot() {
}
}
}

View File

@ -1,7 +0,0 @@
namespace TicTacToe {
enum Player {
Empty = 0,
Cross = 1,
Circle = 2
}
}