Esempio n. 1
0
    public GameObject getNextFollowUpCard()
    {
        int shortestWaiting = 999;
        C_folluwUpStackElement nextElement = null;

        foreach (C_folluwUpStackElement fuse in followUpStack.followUpStack)
        {
            if (fuse.cardDelay <= 0)
            {
                if (fuse.waitingTime < shortestWaiting)
                {
                    shortestWaiting = fuse.waitingTime;
                    nextElement     = fuse;
                }
            }
        }

        if (nextElement != null)
        {
            //get the element from the cardstack;
            GameObject nextGO = null;
            if (cardIndexValid(nextElement.followUpCard))
            {
                nextGO = allCards[nextElement.followUpCard.groupIndex].groupCards[nextElement.followUpCard.cardSubIndex];
            }
            followUpStack.followUpStack.Remove(nextElement);
            saveFollowUpStack();

            return(nextGO);
        }
        else
        {
            return(null);
        }
    }
Esempio n. 2
0
    public void addToFollowUpStack(GameObject element, int delay)
    {
        C_folluwUpStackElement newElement = new C_folluwUpStackElement();

        cardIndex aci = getCardIndex(element);
        cardIndex ci  = new cardIndex();

        ci.cardSubIndex = aci.cardSubIndex;
        ci.groupIndex   = aci.groupIndex;
        ci.validIndex   = aci.validIndex;

        newElement.followUpCard = ci;
        newElement.cardDelay    = delay;
        newElement.waitingTime  = 0;

        followUpStack.followUpStack.Add(newElement);
        saveFollowUpStack();
    }