StatusEffect.CheckRequirements C# (CSharp) Method

CheckRequirements() private method

private CheckRequirements ( Combatant, c, bool doCheck, StatusRequirement, req, AIConditionNeeded needed ) : bool
c Combatant,
doCheck bool
req StatusRequirement,
needed AIConditionNeeded
return bool
    private bool CheckRequirements(Combatant c, bool doCheck, StatusRequirement[] req, AIConditionNeeded needed)
    {
        bool check = false;
        if(doCheck)
        {
            check = true;
            bool any = false;
            for(int i=0; i<req.Length; i++)
            {
                if(req[i].CheckRequirement(c))
                {
                    any = true;
                }
                else if(AIConditionNeeded.ALL.Equals(needed))
                {
                    check = false;
                    break;
                }
            }
            if(AIConditionNeeded.ONE.Equals(needed) && !any &&
                req.Length > 0)
            {
                check = false;
            }
        }
        return check;
    }