Ejemplo n.º 1
0
        // Initializes a new Game of Life.
        public GameOfLifeService()
        {
            //Get app settings
            var _appSettings = ConfigurationSettings.GetConfiurationSettings();

            this.Heigth = _appSettings.Heigth;
            this.Width  = _appSettings.Width;
            cells       = new bool[_appSettings.Heigth, _appSettings.Width];
            GenerateField();
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            // DI/Ioc register dependencies
            var _serviceProvider = DependencyInjection.ConfigureIoCc();

            //Get app settings
            var _appSettings = ConfigurationSettings.GetConfiurationSettings();

            //Begin Game of Life
            int runs = 0;

            while (runs++ < _appSettings.MaxRuns)
            {
                _serviceProvider.Resolve <IGameOfLifeService>().DrawAndGrow();
                System.Threading.Thread.Sleep(_appSettings.SleepTime);
            }
        }