Exemple #1
0
 public void ApplyTo(IEnumerable <MapNode> nodes)
 {
     foreach (var n in nodes)
     {
         RefNode.CopyFormatTo(n);
     }
 }
 public void InitializePose(Pose.CGfxSkeletonPose pose)
 {
     OutPose  = pose.Clone();
     mAddPose = pose.Clone();
     mRefPose = pose.Clone();
     AdditiveNode?.InitializePose(pose);
     RefNode?.InitializePose(pose);
 }
 public void Evaluate(float timeInSecond)
 {
     if (RefNode == null || AdditiveNode == null)
     {
         Bricks.Animation.Runtime.CGfxAnimationRuntime.ZeroPose(OutPose);
         return;
     }
     RefNode.Evaluate(timeInSecond);
     AdditiveNode.Evaluate(timeInSecond);
     Bricks.Animation.Runtime.CGfxAnimationRuntime.CopyPoseAndConvertRotationToMeshSpace(mAddPose, AdditiveNode.OutPose);
     Bricks.Animation.Runtime.CGfxAnimationRuntime.CopyPoseAndConvertRotationToMeshSpace(mRefPose, RefNode.OutPose);
     Bricks.Animation.Runtime.CGfxAnimationRuntime.MinusPose(OutPose, mRefPose, mAddPose);
 }
            public IEnumerable <object> Children(object objNode)
            {
                ITreeViewControllerNode treeNode = (ITreeViewControllerNode)objNode;

                if (treeNode.m_nodeList != null)
                {
                    // Case 1 the root node
                    for (int i = 0; i < treeNode.m_nodeList.Count; i++)
                    {
                        yield return(new ITreeViewControllerNode(treeNode.m_nodeList[i], i + 1));
                    }
                }
                else
                {
                    // Case 2 all other nodes.
                    if (treeNode.IsRefByNode)
                    {
                        RefNode node     = m_refGraph.GetNode(treeNode.m_nodeIdx, m_refGraph.AllocNodeStorage());
                        int     childNum = 1;
                        var     nextIdx  = node.GetFirstChildIndex();
                        while (nextIdx != NodeIndex.Invalid)
                        {
                            yield return(new ITreeViewControllerNode(nextIdx, childNum, true));

                            nextIdx = node.GetNextChildIndex();
                            childNum++;
                        }
                    }
                    else
                    {
                        // Normal nodes.
                        yield return(new ITreeViewControllerNode(treeNode.m_nodeIdx, -1));       // Return a 'Referenced By Node'

                        Node node = m_graph.GetNode(treeNode.m_nodeIdx, m_graph.AllocNodeStorage());
                        node.ResetChildrenEnumeration();
                        int childNum = 1;
                        while (true)
                        {
                            var nextIdx = node.GetNextChildIndex();
                            if (nextIdx == NodeIndex.Invalid)
                            {
                                break;
                            }

                            yield return(new ITreeViewControllerNode(nextIdx, childNum));

                            childNum++;
                        }
                    }
                }
            }
Exemple #5
0
 public override void build()
 {
     if (isConstant)
     {
         jsonLit = (TermNode)children[0];
     }
     else if (isRef)
     {
         refNode = (RefNode)children[0];
     }
     else
     {
         primSteps = children.Select(_ => (PrimitiveStepNode)_).ToArray();
     }
 }
Exemple #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BulletMLLib.BulletMLFire"/> class.
        /// </summary>
        /// <param name="node">Node.</param>
        /// <param name="owner">Owner.</param>
        public BulletMLFire(BulletMLNode node, BulletMLTask owner) : base(node, owner)
        {
            Debug.Assert(null != Node);
            Debug.Assert(null != Owner);

            //First try and get the nodes striaght from our node
            DirNode    = node.GetChild(ENodeName.direction);
            SpeedNode  = node.GetChild(ENodeName.speed);
            RefNode    = node.GetChild(ENodeName.bulletRef);
            BulletNode = node.GetChild(ENodeName.bullet);

            //ok fire nodes HAVE TO have either a ref or a bullet node
            Debug.Assert((null != RefNode) || (null != BulletNode));

            //what we gonna use to set the direction if we couldnt find a node?
            if (null == DirNode)
            {
                if (null != RefNode)
                {
                    //Get the direction from the reference node
                    DirNode = RefNode.GetChild(ENodeName.direction);
                }
                else if (BulletNode != null)
                {
                    //Set teh driection from teh bullet node
                    DirNode = BulletNode.GetChild(ENodeName.direction);
                }
            }

            //what we gonna use to set teh speed if we couldnt find a node?
            if (null == SpeedNode)
            {
                if (null != RefNode)
                {
                    //set the speed from teh refernce node
                    SpeedNode = RefNode.GetChild(ENodeName.speed);
                }
                else if (null != BulletNode)
                {
                    //set teh speed from the bullet node
                    SpeedNode = BulletNode.GetChild(ENodeName.speed);
                }
            }
        }
Exemple #7
0
            public CircularLinkedList_ContainsBackpointingRef()
            {
                numberOfNodes = 4;
                RefNode currentNode = null, prevNode = null;

                start = null;
                for (int i = 0; i < numberOfNodes; i++)
                {
                    currentNode = new RefNode(i, "Hello World");
                    if (i == 0)
                    {
                        start = currentNode;
                    }
                    if (prevNode != null)
                    {
                        prevNode.Next = currentNode;
                    }
                    prevNode = currentNode;
                }
                currentNode.Next = start;
            }
            public int ChildCount(object objNode)
            {
                ITreeViewControllerNode treeNode = (ITreeViewControllerNode)objNode;

                if (treeNode.m_nodeList != null)
                {
                    return(treeNode.m_nodeList.Count);                                   // Case 1 we are the root node
                }
                else
                {
                    if (treeNode.IsRefByNode)
                    {
                        RefNode refNode = m_refGraph.GetNode(treeNode.m_nodeIdx, m_refNodeStorage);
                        return(refNode.ChildCount);
                    }
                    else
                    {
                        Node node = m_graph.GetNode(treeNode.m_nodeIdx, m_nodeStorage);     // Case 2 all other nodes.
                        return(node.ChildCount + 1);                                        // +1 is for the Referenced By Node.
                    }
                }
            }
Exemple #9
0
 public void ApplyTo(MapNode node)
 {
     RefNode.CopyFormatTo(node);
 }
 public void Notifying(GamePlay.Component.GComponent component)
 {
     RefNode?.Notifying(component);
     AdditiveNode?.Notifying(component);
 }