Exemplo n.º 1
0
 public bool HandleEvent(IGenericEvent evt)
 {
     if (evt is EndCollisionEvent)
     {
         EndCollisionEvent ece = evt as EndCollisionEvent;
         HandleEndCollisionEvent(ece.entityA, ece.entityB);
         return(true);
     }
     if (evt is AddCardtoDeckEvent)
     {
         //Debug.Log("Add Card to Deck Event recieved");
         AddCardtoDeckEvent acd = evt as AddCardtoDeckEvent;
         bool result            = AddCardToDeck(acd.cardID);
         if (result)
         {
             //Debug.Log("Calling Add to Deck List UI");
             EventManager.instance.QueueEvent(new AddCardtoDeckScrollListEvent(acd.cardID, acd.cardName, acd.traits, acd.flavor));
             return(true);
         }
         else
         {
             Debug.Log("Add to Deck List failed, too many copies of the same card! The max number is: " + Constants.MaxCopiesPerDeck);
             return(false);
         }
     }
     if (evt is DeckBuilderHandAdjustEvent)
     {
         DeckBuilderHandAdjustEvent se = evt as DeckBuilderHandAdjustEvent;
         AdjustPlayerHand(se.card);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public bool HandleEvent(IGenericEvent evt)
 {
     if (evt is EndCollisionEvent)
     {
         EndCollisionEvent ece = evt as EndCollisionEvent;
         HandleEndCollisionEvent(ece.entityA, ece.entityB);
         return(true);
     }
     return(false);
 }