Ejemplo n.º 1
0
 public void Serialize()
 {
     if (_root != null)
     {
         _rootNode = new SerializableQuadTreeNode(_root, null);
     }
 }
Ejemplo n.º 2
0
            public SerializableQuadTreeNode(QuadTreeNode <QTCircleCollider> node,
                                            SerializableQuadTreeNode parent)
            {
                children = new SerializableQuadTreeNode[4];

                isNotNull   = true;
                this.parent = parent;

                depthLevel = node.level;
                bounds     = node.bounds;

                for (int i = 0; i < node.objects.Count; i++)
                {
                    objects.Add(node.objects[i].obj);
                }

                int childCount = 0;

                for (int i = 0; i < node.nodes.Length; i++)
                {
                    if (node.nodes[i] != null)
                    {
                        children[i] = new SerializableQuadTreeNode(node.nodes[i], this);
                        childCount++;
                    }
                    else
                    {
                        children[i] = null;
                    }
                }

                name = "Node (child=" + childCount + ") (objects=" + node.objects.Count + ")";
            }