Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public PresentationManager(Canvas gameCanvas, GameManager gameManager)
        {
            if (null == gameManager)
            {
                throw new ArgumentNullException("gameManager");
            }

            this.gameCanvas = gameCanvas;
            this.gameManager = gameManager;
        }
Exemplo n.º 3
0
        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);
        }