Example #1
0
        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);
        }
Example #2
0
        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);
        }