void InitLabelsInfo() {
     pairArray = new Set<IntPair>(from v in bottomLayer
                                  where v < IntGraph.NodeCount
                                  from edge in IntGraph.OutEdges(v)
                                  where edge.Source != edge.Target
                                  where Layering[edge.Target] == Layering[edge.Source]
                                  select new IntPair(edge.Source, edge.Target)).ToArray();
     labelCenters = new double[pairArray.Length];
     int i = 0;
     foreach (IntPair p in pairArray) {
         int leftNode, rightNode;
         if (LayerArrays.X[p.First] < LayerArrays.X[p.Second]) {
             leftNode = p.First;
             rightNode = p.Second;
         } else {
             leftNode = p.Second;
             rightNode = p.First;
         }
         labelCenters[i++] = (Database.Anchors[leftNode].Right + Database.Anchors[rightNode].Left)/2;
         //labelCenters contains ideal position for nodes at the moment
     }
     InitLabelsToLabelObstacles();
 }
Exemple #2
0
 public InfoBag()
 {
     Resource = new GameResource();
     Items = new IntPair[50];
 }