コード例 #1
0
    public List <Stack_Effect> GetEffect(StackConditionInfo info)
    {
        var list = new List <Stack_Effect>();

        if (Condition(info) == true)
        {
            list.AddRange(listEffects);
            if (child != null)
            {
                list.AddRange(child.GetEffect(info));
            }
        }
        else
        {
            if (neighbour != null && neighbour.myOperator.condition == StackControllerType.Else)
            {
                list.AddRange(neighbour.GetEffect(info));
            }
        }
        if (neighbour != null && neighbour.myOperator.condition == StackControllerType.Or)
        {
            list.AddRange(neighbour.GetEffect(info));
        }
        return(list);
    }
コード例 #2
0
    public List <T> GetEffects <T>(StackConditionInfo info) where T : Stack_Effect
    {
        var list   = new List <T>();
        var assets = GetAssets <StackElement>();
        StackHelper_Controller helper = null;

        for (int i = 0; i < assets.Count; i++)
        {
            var a = assets[i];
            if (a is Stack_Effect)
            {
                list.Add(a as T);
            }
            if (a is Stack_Controller)
            {
                helper = CreateHelper(assets.GetRange(i, assets.Count));
                break;
            }
            if (a is Stack_Condition)
            {
                Debug.LogError(name + " : Hier shouldn't be a condition");
            }
        }
        if (helper != null)
        {
            list.AddRange(helper.GetEffect(info).Cast <T>());
        }

        return(list);
    }
コード例 #3
0
 bool Condition(StackConditionInfo info)
 {
     foreach (var c in listCondition)
     {
         if (c.Condition(info) == false)
         {
             return(false);
         }
     }
     return(true);
 }
コード例 #4
0
 public abstract bool Condition(StackConditionInfo info);
コード例 #5
0
 public override bool Condition(StackConditionInfo info)
 {
     return(false);
 }