Exemplo n.º 1
0
 public void Init()
 {
     leaves.Clear();
     tree.Clear();
     if (splitCall == null)
     {
         splitCall = SplitNode;
     }
     root = new DungeonNode2D(area, this);
 }
Exemplo n.º 2
0
 public void Split(Dungeon2D.Split splitCall)
 {
     this.root.leaves.Remove(this);
     Rect[] areas = splitCall(area);
     if (areas == null)
     {
         return;
     }
     left  = new DungeonNode2D(areas[0], root, depth + 1);
     right = new DungeonNode2D(areas[1], root, depth + 1);
 }