Ejemplo n.º 1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     game              = new GameOfLifeGame(10, 10);
     game.UpdateEvent += UpdateUI;
     game.SetTo(new ToadShape());
     cellColorPicker       = new CellColorPicker(game.settings);
     cellColorPicker.Title = this.Title;
     cellColorPicker.Icon  = this.Icon;
 }
Ejemplo n.º 2
0
        private void RefreshSizeButton_Click(object sender, RoutedEventArgs e)
        {
            var newSize = 10;

            if (int.TryParse(GridSizeTextBox.Text, out newSize))
            {
                game              = new GameOfLifeGame(newSize, newSize);
                game.UpdateEvent += UpdateUI;
                UpdateUI(null, EventArgs.Empty);
            }
        }
Ejemplo n.º 3
0
        public static IGame CreateGridGame(GameName gameName, int rows, int columns)
        {
            IGame game = null;

            switch (gameName)
            {
            case GameName.GameOfLife:
                game = new GameOfLifeGame(rows, columns);
                break;

            default:
                game = new GameOfLifeGame(rows, columns);
                break;
            }

            return(game);
        }
Ejemplo n.º 4
0
 public static void Main()
 {
     using (var game = new GameOfLifeGame())
         game.Run();
 }