public Playground(ILifeGame lifeGame, Size size) { if (lifeGame != null) throw new ArgumentNullException("lifeGame"); lifeGame.Initialize(size); _LifeGame = lifeGame; }
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(); }