public Game(GameManager gameManager, MainWindow window) { this.gameManager = gameManager; this.window = window; gameManager.OnCoinCaptured += (sender, args) => OnCoinCaptured(); gameManager.OnPropertyChange += OnPropertyChanged; gameManager.OnStart += (o, e) => OnStart(); }
public PresentationManager(Canvas gameCanvas, GameManager gameManager) { if (null == gameManager) { throw new ArgumentNullException("gameManager"); } this.gameCanvas = gameCanvas; this.gameManager = gameManager; }
public MainWindow() { InitializeComponent(); this.gameManager = new GameManager(TaskScheduler.FromCurrentSynchronizationContext()); this.presentationManager = new PresentationManager(this.GameCanvas, this.gameManager); this.gameManager.OnStart += (o, e) => this.presentationManager.Reset(); this.gameManager.OnPresent += (o, e) => this.presentationManager.Update(); this.game = new Game(gameManager, this); }