public void CannotOverwritePieceInSlot() { var board = new Board(3, 3); var slot = board.SlotAt(0, 0); slot.Piece = new Piece(); slot.Piece = new Piece(); }
public void FullBoardReturnsNullForRandomEmptySlot() { var board = new Board(3, 3); foreach (var slot in board.Slots) slot.Piece = new Piece(); Assert.IsNull(board.GetRandomEmptySlot()); }
public void ThirtySlotsForFiveBySixBoard() { var board = new Board(5, 6); Assert.AreEqual(30, board.Slots.Count()); }
public void OneSlotForOneByOneBoard() { var board = new Board(1, 1); Assert.AreEqual(1, board.Slots.Count()); }
public Game(int x, int y) { Players = new List<Player>(); Board = new Board(x, y); sweep = new Sweep(Board, new PiecesInARowClearingRule(this, 4)); }
public Sweep(Board board, IClearingRule clearingRule) { this.board = board; this.counter = 0; this.clearingRule = clearingRule; // Scale the update interval based on the size of the board updateInterval = Math.Max(1, (int)(10 / Math.Round(((decimal)(board.Width + board.Height)) / 10m))); }