public Board() { state = new Position[9]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { state[3 * i + j] = new Position(i, j); } } }
public void Mark(bool team, Position p) { var x = state.Single(t => t.x == p.x && t.y == p.y); x.occupied = true; x.marker = GetMarker(team); }