Ejemplo n.º 1
0
 private void OnMusicEnd(MusicEndedEvent obj)
 {
     MessageBroker.Default.Publish(new GameMsgEnd());
     MessageBroker.Default.Publish(new SelectToolAction {
         ToolToSelect = CurrentTool.Broom
     });
 }
Ejemplo n.º 2
0
        public void Handle(MusicEndedEvent message)
        {
            if (!IsRunning)
            {
                return;
            }

            if (!IsMultiplayer)
            {
                _eventAggregator.Publish(new GameOverEvent()
                {
                    IsTie = false, PlayerWon = PlayerID.Player1
                });
                return;
            }

            if (Player1.Points > Player2.Points)
            {
                _eventAggregator.Publish(new GameOverEvent()
                {
                    IsTie = false, PlayerWon = PlayerID.Player1
                });
            }
            else if (Player1.Points < Player2.Points)
            {
                _eventAggregator.Publish(new GameOverEvent()
                {
                    IsTie = false, PlayerWon = PlayerID.Player2
                });
            }
            else
            {
                _eventAggregator.Publish(new GameOverEvent()
                {
                    IsTie = true
                });
            }
        }
Ejemplo n.º 3
0
        public void Handle(MusicEndedEvent message)
        {
            if (!IsActive)
            {
                return;
            }

            IsPopupShowing = true;
            _eventAggregator.Publish(new ShowPopupEvent()
            {
                PopupType     = PopupType.ButtonsPopup,
                PopupSettings = (vm) =>
                {
                    (vm as ButtonsPopupViewModel).Buttons.AddRange(new List <string>()
                    {
                        "Save the sequence", "Play again", "Go back"
                    });
                    (vm as ButtonsPopupViewModel).Message   = "The end";
                    (vm as ButtonsPopupViewModel).PopupId   = 2;
                    (vm as ButtonsPopupViewModel).CanCancel = false;
                }
            });
        }