public bool Apply(ConstrainsState ancestor, ConstrainsState descendant, TicNode ancestorNode, TicNode descendantNode) { var ancestorCopy = ancestor.GetCopy(); ancestorCopy.AddDescedant(descendant.Descedant); var result = ancestorCopy.GetOptimizedOrNull(); if (result == null) { return(false); } ancestorNode.State = result; return(true); }
private static bool ApplyAncestorConstrains(TicNode ancestorNode, ConstrainsState ancestor, ITypeState typeDesc) { var ancestorCopy = ancestor.GetCopy(); ancestorCopy.AddDescedant(typeDesc); var result = ancestorCopy.GetOptimizedOrNull(); if (result == null) { return(false); } ancestorNode.State = result; return(true); }