Beispiel #1
0
        public override void OnCoreGameEventHandler(OnCoreGameEvent data)
        {
            base.OnCoreGameEventHandler(data);

            switch (data.EventCode)
            {
            case EventCode.MatchBegan:
            {
                CoreGameRoot.ExecuteRootMatchBegan();
                break;
            }

            case EventCode.ShowCardAndTurnNext:
            {
                int             current_cards_actor_id = Convert.ToInt32(Network.Client.CurrentRoom.CustomProperties ["current_cards_actor_id"]);
                PlayerViewModel currentCardsPlayer     = CoreGameRoot.PlayerCollection.SingleOrDefault(vm => vm.ActorId == current_cards_actor_id);
                currentCardsPlayer.ExecuteShowCardsToPile();
                CoreGameRoot.ExecuteRefreshCoreGame();
                break;
            }

            case EventCode.PassAndTurnNext:
            {
                CoreGameRoot.ExecuteRefreshCoreGame();
                break;
            }

            case EventCode.MatchOver:
            {
                CoreGameRoot.ExecuteRootMatchOver();
                break;
            }

            case EventCode.ClearCardsInPile:
            {
                CoreGameRoot.Pile.Cards.Clear();
                break;
            }

            default:
                break;
            }
        }
Beispiel #2
0
 /// <summary>
 // This method is executed when using this.Publish(new OnCoreGameEvent())
 /// </summary>
 public virtual void OnCoreGameEventHandler(OnCoreGameEvent data)
 {
     // Process the commands information.  Also, you can publish new events by using the line below.
     // this.Publish(new AnotherEvent())
 }