Added proprietary user interface.
Added most game logic.
This commit is contained in:
@ -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() {
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
namespace TicTacToe {
|
||||
enum Player {
|
||||
Empty = 0,
|
||||
Cross = 1,
|
||||
Circle = 2
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user