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); }
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); }
bool Condition(StackConditionInfo info) { foreach (var c in listCondition) { if (c.Condition(info) == false) { return(false); } } return(true); }
public abstract bool Condition(StackConditionInfo info);
public override bool Condition(StackConditionInfo info) { return(false); }