private void InitializeMembers(GameUniverse currentGenerationGameUniverse) { _aliveNeighboursCountForCurrentlyAlivePoints = new Dictionary <Point, int>(); _aliveNeighboursCountForCurrentlyDeadPoints = new Dictionary <Point, int>(); _gameUniverse = currentGenerationGameUniverse; _aliveCellPoints = currentGenerationGameUniverse.AliveCells.Select(x => new VisitablePoint(x)).ToList(); }
public List <Point> GetAliveCellsForNextGeneration(GameUniverse currentGenerationGameUniverse) { InitializeMembers(currentGenerationGameUniverse); CalculateCandidatePointsForNextGeneration(); List <Point> alivePointsForNextGenerationThatAreCurrentlyDead = GetAlivePointsForNextGenerationThatAreCurrentlyDead(); List <Point> alivePointsForNextGenerationThatAreCurrentlyAlive = GetAlivePointsForNextGenerationThatAreCurrentlyAlive(); var alivePointsForNextGeneration = new List <Point>(alivePointsForNextGenerationThatAreCurrentlyDead); alivePointsForNextGeneration.AddRange(alivePointsForNextGenerationThatAreCurrentlyAlive); return(alivePointsForNextGeneration); }
// TODO - set up DI container to discover Generation Strategy public GameController(IGenerationSrategy generationSrategy, GameUniverse gameUniverse) { _generationSrategy = generationSrategy; _gameUniverse = gameUniverse; }