示例#1
0
    void ShuffleCards(CombatantBehavior combatant, Transform combatantTransform)
    {
        bool keepGoing = true;

        while (keepGoing)
        {
            if (combatant.GetNextOpenSlot() < handAmount && combatant.GetNextOpenSlot() != -1)
            {
                int openSlot = combatant.GetNextOpenSlot();
                //Probably not good to try/catch this.
                try
                {
                    CardBehavior card = cardScripts[combatant.GetCardInSlot(openSlot + 1)];
                    card.MoveSlot(openSlot, combatantTransform.GetChild(openSlot));
                    combatant.SetOccupiedSlot(openSlot + 1, false, -1);
                    combatant.SetOccupiedSlot(card.GetSlot(), true, card.GetSessionId());
                }
                catch
                {
                    keepGoing = false;
                }
            }
            else
            {
                keepGoing = false;
            }
        }
    }