Exemple #1
0
        public static GraphNode Read(Reader reader, Pointer offset)
        {
            GraphNode node = new GraphNode(offset);

            MapLoader.Loader.graphNodes.Add(node);

            node.off_nextNode = Pointer.Read(reader);
            node.off_prevNode = Pointer.Read(reader);

            node.off_graph    = Pointer.Read(reader);
            node.off_wayPoint = Pointer.Read(reader);
            if (Settings.s.engineVersion != Settings.EngineVersion.Montreal)
            {
                node.typeOfWP     = reader.ReadUInt32();
                node.typeOfWPInit = reader.ReadUInt32();
            }
            node.off_arcList = Pointer.Read(reader);

            //MapLoader.Loader.print("ArcList: "+node.off_arcList);

            /*Pointer start = Pointer.Goto(ref reader, node.off_node);
             * node.node = GraphNode.Read(reader, node.off_node);
             * Pointer.Goto(ref reader, start);*/

            node.wayPoint = WayPoint.FromOffsetOrRead(node.off_wayPoint, reader);
            if (node.wayPoint != null)
            {
                node.wayPoint.containingGraphNodes.Add(node);
            }
            Pointer.DoAt(ref reader, node.off_arcList, () => {
                node.arcList = ArcList.Read(reader, node.off_arcList);
            });

            return(node);
        }
Exemple #2
0
        public static ArcList Read(Reader reader, Pointer offset)
        {
            ArcList arcList = new ArcList(offset);

            Pointer.DoAt(ref reader, offset, () => {
                //zdxList = LinkedList<CollideMeshObject>.ReadHeader(r1, o1);
                arcList.list = LinkedList <Arc> .Read(ref reader, offset,
                                                      (off_element) => {
                    return(Arc.Read(reader, off_element));
                },
                                                      flags: LinkedList.Flags.HasHeaderPointers,
                                                      type: LinkedList.Type.Double
                                                      );
            });

            return(arcList);
        }