public Vertex(string label, LocationXY location)
 {
     Label         = label;
     IncidentEdges = new List <UndirectedEdge>();
     Distance      = int.MaxValue;
     IsVisited     = false;
     Location      = location;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor building xy table
        /// </summary>
        /// <param name="dataRef">data ovl reference for extracting xy coordinates</param>
        public LargeMapLocationReferences(DataOvlReference dataRef)
        {
            // Load the location XYs and map them against the location
            List <byte> xLocs = dataRef.GetDataChunk(DataOvlReference.DataChunkName.LOCATIONS_X).GetAsByteList();
            List <byte> yLocs = dataRef.GetDataChunk(DataOvlReference.DataChunkName.LOCATIONS_Y).GetAsByteList();

            Debug.Assert(xLocs.Count == yLocs.Count);

            for (int nVector = 0; nVector < N_TOTAL_LOCATIONS; nVector++)
            {
                Point2D mapPoint = new Point2D(xLocs[nVector], yLocs[nVector]);
                SmallMapReferences.SingleMapReference.Location location = (SmallMapReferences.SingleMapReference.Location)nVector + 1;
                LocationXY.Add(location, mapPoint);
                LocationXYLocations.Add(mapPoint, location);
            }
        }
Exemplo n.º 3
0
        public LargeMapReference(DataOvlReference dataRef, SmallMapReferences smallMapRef)
        {
            // Load the location XYs and map them against the location
            List <byte> xLocs = dataRef.GetDataChunk(DataOvlReference.DataChunkName.LOCATIONS_X).GetAsByteList();
            List <byte> yLocs = dataRef.GetDataChunk(DataOvlReference.DataChunkName.LOCATIONS_Y).GetAsByteList();

            Debug.Assert(xLocs.Count == yLocs.Count);

            // Towns, Dwellings, Castles, Keeps, Dungeons

            //List<Point2D> vectors = new List<Point2D>();
            for (int nVector = 0; nVector < 0x28; nVector++)
            {
                Point2D mapPoint = new Point2D(xLocs[nVector], yLocs[nVector]);
                SmallMapReferences.SingleMapReference.Location location = (SmallMapReferences.SingleMapReference.Location)nVector + 1;
                //vectors.Add(new Point2D(xLocs[nVector], yLocs[nVector]));
                //                LocationXY.Add((SmallMapReferences.SingleMapReference.Location)nVector + 1, new Point2D(xLocs[nVector], yLocs[nVector]));
                LocationXY.Add(location, mapPoint);
                LocationXYLocations.Add(mapPoint, location);
            }
        }