private void ResetSelections()
 {
     if (ActiveCard != null)
     {
         ActiveCard.Deselect();
     }
     ActiveCard = null;
     foreach (PlayingCard C in Selection)
     {
         C.Deselect();
     }
     Selection.Clear();
 }
        public void CardPlaced(UICard inPlacedCard, CardZoneType PlacedZone)
        {
            PlayingCard PlacedCard = (PlayingCard)inPlacedCard;

            if (!SecondSelect)
            {
                SendAction(new ActionOrder(new PlaceCard_Action(PlacedCard.GetEntity(), PlacedZone), null, null));
            }
            UpdateUI();
            if ((PlacedCard).IsPlaced() && PlacedCard.GetEntity().PAHolder.HasAction())
            {
                StartPlacedAction(PlacedCard);
            }
        }
 private void SetActive(PlayingCard ActiveCard)
 {
     this.ActiveCard        = ActiveCard;
     CurrentPossibleActions = ActiveCard.GetEntity().GetActions();
     CurrentActionIndex     = 0;
     if (CurrentPossibleActions.Count > 0)
     {
         ActionButton.GetComponentInChildren <Text>().text = CurrentPossibleActions[CurrentActionIndex].ActionName;
         TestActionConditions();
     }
     if (CurrentPossibleActions.Count > 1)
     {
         CycleButton.interactable = true;
     }
 }
 public void StartPlacedAction(PlayingCard PlacedCard)
 {
     if (PlacedCard.GetEntity().PAHolder.GetAction().Max == 0)
     {
         SendAction(new ActionOrder(PlacedCard.GetEntity().PAHolder.GetAction().mAction, PlacedCard.GetEntity(), new List <Entities.Entity>()));
         ResetActions();
         ResetSelections();
         UpdateUI();
     }
     else
     {
         ResetActions();
         ResetSelections();
         PlacedCard.ToggleSelect(false);
         ActiveCard             = PlacedCard;
         CurrentPossibleActions = new List <ActionInfo>();
         CurrentPossibleActions.Add(PlacedCard.GetEntity().PAHolder.GetAction());
         CurrentActionIndex = 0;
         ActionButton.GetComponentInChildren <Text>().text = CurrentPossibleActions[CurrentActionIndex].ActionName;
         StartSecondarySelect();
     }
 }
        public void CardSelected(PlayingCard SelectedCard)
        {
            if (((PlayingCard)SelectedCard).IsPlaced() || TheTurnInformation.IsMulligan)
            {
                if (SecondSelect)
                {
                    if (CurrentPossibleActions[CurrentActionIndex].SelectType == PlayerType.Ally &&
                        SelectedCard.GetEntity().GetOwnerIndex() != TheTurnInformation.GetCPI())
                    {
                        return;
                    }
                    if (CurrentPossibleActions[CurrentActionIndex].SelectType == PlayerType.Enemy &&
                        SelectedCard.GetEntity().GetOwnerIndex() == TheTurnInformation.GetCPI())
                    {
                        return;
                    }
                    if (SelectedCard == ActiveCard)
                    {
                        return;
                    }
                    if (SelectedCard.ToggleSelect(false))
                    {
                        Selection.Add(SelectedCard);
                    }
                    else
                    {
                        Selection.Remove(SelectedCard);
                    }
                    TestActionConditions();
                    return;
                }
                if (SelectedCard.GetEntity().GetOwnerIndex() == TheTurnInformation.GetCPI())
                {
                    if (SelectedCard.ToggleSelect(false))
                    {
                        Selection.Add(SelectedCard);
                    }
                    else
                    {
                        Selection.Remove(SelectedCard);
                    }

                    if (Selection.Count == 1)
                    {
                        if (TheTurnInformation.IsMulligan)
                        {
                            ActiveCard             = Selection[0];
                            CurrentPossibleActions = mMulliganAction;
                            CurrentActionIndex     = 0;
                            ActionButton.GetComponentInChildren <Text>().text = "Mulligan";
                            TestActionConditions();
                        }
                        else
                        {
                            SetActive(Selection[0]);
                        }
                    }
                    else
                    {
                        ResetActions();
                    }
                }
            }
        }