コード例 #1
0
ファイル: Game.cs プロジェクト: AdBon88/kata-game-of-life
        private void ApplyGameRules(int[] currentCellCoords, List <int[]> neighbourCoords, Grid gridCopy)
        {
            var liveNeighbourCellCount = neighbourCoords.Count(gridCopy.CellIsAliveAtCoords);

            if (gridCopy.CellIsAliveAtCoords(currentCellCoords))
            {
                ApplyRulesForLiveCell(currentCellCoords, liveNeighbourCellCount);
            }
            else
            {
                ApplyRulesForDeadCell(currentCellCoords, liveNeighbourCellCount);
            }
        }