コード例 #1
0
ファイル: Playground.cs プロジェクト: M3fN/LifeEvolution
        public Playground(ILifeGame lifeGame, Size size)
        {
            if (lifeGame != null)
                throw new ArgumentNullException("lifeGame");

            lifeGame.Initialize(size);

            _LifeGame = lifeGame;
        }
コード例 #2
0
        public MainWindowViewModel(IEventAggregator _eventAggregator, ILifeGame game)
        {
            eventAggregator = _eventAggregator;

            NGenerationsButtonCommand   = new DelegateCommand(CauseNGenerations, CanUseNGenerationsButton).ObservesProperty(() => NGenerationsInput);
            NextGenerationButtonCommand = new DelegateCommand(CauseNextGeneration);

            eventAggregator.GetEvent <SettingChangedEvent>().Subscribe(settingChanged);
            eventAggregator.GetEvent <LoadGameEvent>().Subscribe(LoadGameRequested);
            eventAggregator.GetEvent <SaveGameEvent>().Subscribe(SaveGameRequested);

            CellClickCommand = new DelegateCommand <object>(GameCellClicked);
            this.Game        = game;
            synchronizeWithModel();
        }