private void ProcessWall(int i, Transform transform, Node node, RoadNode roadNode) { mainAi.CurNode.IsNotWall(i); roadNode.IsNotWall((i + 2) % 4); Verticie vert = new Verticie(); vert.first = node; vert.second = mainAi.CurNode.Node; mainAi.MaphGraph.nodes.Add(node); mainAi.MaphGraph.verticies.Add(vert); }
private void DoId() { List <Node> nodes = new List <Node>(); List <Verticie> verticies = new List <Verticie>(); for (int i = 0; i < 20; ++i) { for (int j = 0; j < 20; ++j) { Node node = new Node(2 * i, 2 * j); nodes.Add(node); } } for (int i = 0; i < 20; ++i) { for (int j = 0; j < 20; ++j) { Verticie first = new Verticie(); if (i != 19) { first.first = nodes[i + 20 * j]; first.second = nodes[i + 20 * j + 1]; verticies.Add(first); } Verticie second = new Verticie(); if (j != 19) { second.first = nodes[i + 20 * j]; second.second = nodes[i + 20 * (j + 1)]; verticies.Add(second); } } } Graph graph = new Graph(nodes, verticies); pair = graph.GetMST(); Graph mst = pair.First; GenerateMap(mst, pair.Second); }