Esempio n. 1
0
    public bool canIAdvance()
    {
        if (!active || complete)
        {
            return(false);
        }

        if (currentObjective.advanceConditionGate == AdvanceConditionGate.OR)
        {
            bool advance = false;
            foreach (KeyValuePair <int, bool> entry in currentObjective.advanceConditions)
            {
                advance = currentObjective.IsTaskComplete(entry.Key);
                if (advance)
                {
                    break;
                }
            }
            return(advance);
        }

        if (currentObjective.advanceConditionGate == AdvanceConditionGate.AND)
        {
            bool advance = true;
            foreach (KeyValuePair <int, bool> entry in currentObjective.advanceConditions)
            {
                advance = currentObjective.IsTaskComplete(entry.Key);
                if (!advance)
                {
                    break;
                }
            }
            return(advance);
        }
        Debug.Log("The current objective does not have an advance condition gate!");
        Debug.Assert(false);
        return(false);
    }