Exemplo n.º 1
0
        public void ShouldSetupCells()
        {
            // arrange
            CellsBuilder cellsBuilder = new CellsBuilder();

            // act
            List <Cell> cellList = cellsBuilder.SetupCartesianGrid(3, 3);

            // assert
            cellList.Should().HaveCount(9);
        }
Exemplo n.º 2
0
        public God(CellsBuilder cellsBuilder, RelationshipsBuilder relationshipsBuilder, IRule rule)
        {
            List <Cell> cells = cellsBuilder.SetupCartesianGrid(3, 3);

            Relationships relationships = relationshipsBuilder.GetCellRelationships(cells, 3, 3);

            List <Cell> nextTurnCells = new List <Cell>();

            foreach (Cell cell in cells)
            {
                relationships.GetNeighbors(cell);
                Cell nextTurnCell = cell.GenerateNextTurnStatus(rule, cells);

                nextTurnCells.Add(nextTurnCell);
                // update relationship?
            }
        }