public MapNode(ClusteredMap map, Vertex2D location) { this.map = map; this.location = location; }
public MapNode(ClusteredMap map, short x, short y) { this.map = map; this.location = new Vertex2D(x, y); }
public UseTeleportNode(ClusteredMap map, Vertex2D location, MapNode target, short useObject, short useWithObject) : base(map, location, target) { this.useObject = useObject; this.useWithObject = useWithObject; }
public UseTeleportNode(ClusteredMap map, short x, short y, short useObject, short useWithObject, ClusteredMap destMap, short destX, short destY) : base(map, x, y, destMap, destX, destY) { this.useObject = useObject; this.useWithObject = useWithObject; }
public TeleportPadNode(ClusteredMap map, Vertex2D location, MapNode target, Vertex2D padLocation) : base(map, location, target) { this.padLocation = padLocation; }
public TeleportPadNode(ClusteredMap map, short x, short y, short padx, short pady, ClusteredMap destMap, short destX, short destY) : base(map, x, y, destMap, destX, destY) { this.padLocation = new Vertex2D(padx, pady); }
public TeleportNode(ClusteredMap map, short x, short y, ClusteredMap destMap, short destX, short destY) : base(map, x, y) { this.target = new MapNode(destMap, destX, destY); }
public BeamMeNode(ClusteredMap map, short x, short y, ClusteredMap destMap, short destX, short destY) : base(map, x, y, destMap, destX, destY) { }
public POINode(ClusteredMap map, short x, short y) : base(map, x, y) { }
public TeleportNode(ClusteredMap map, Vertex2D location, MapNode target) : base(map, location) { this.target = target; }
public POINode(ClusteredMap map, Vertex2D location) : base(map, location) { }
public BeamMeNode(ClusteredMap map, Vertex2D location, MapNode target) : base(map, location, target) { }
public ObjectPOINode(ClusteredMap map, Object3D object3d) : base(map, (short)(object3d.Location.X * 2 + 0.5), (short)(object3d.Location.Y * 2 + 0.5)) { this.objectId = object3d.ObjectID; }
public bool LoadMaps() { logger.Debug("Loading maps...\n"); availableMaps.Clear(); mapsByName.Clear(); if (!Directory.Exists(MapsPath)) { logger.ErrorLog("Maps path (" + MapsPath + ") does not exist"); return false; } try { string[] elmFiles = Directory.GetFiles(MapsPath, "*.elm*"); foreach (string elmFile in elmFiles) { ClusteredMap m = new ClusteredMap(elmFile); Stream stream = new FileStream(elmFile, FileMode.Open, FileAccess.Read); if (elmFile.ToLower().EndsWith(".gz")) stream = new GZipStream(stream, CompressionMode.Decompress); m.LoadMapData(stream); stream.Close(); logger.Debug(String.Format("Map {1} done (found {0} clusters)\n", m.PathFinder.ClusterCount, m.Name)); AddMap(m); } } catch (Exception ex) { logger.ErrorLog("Error while loading maps from " + MapsPath, ex); return false; } logger.Debug("Maps loaded.\n"); return true; }
public MapNode LoadMapNode(XmlNode xmlNode, ClusteredMap map) { string type = xmlNode.SelectSingleNode("@type").Value; short x = Int16.Parse(xmlNode.SelectSingleNode("location/@x").Value); short y = Int16.Parse(xmlNode.SelectSingleNode("location/@y").Value); switch (type) { default: throw new Exception("Unknown node type: " + type); case "TeleportPadNode": { short padx = Int16.Parse(xmlNode.SelectSingleNode("teleportpad/@x").Value); short pady = Int16.Parse(xmlNode.SelectSingleNode("teleportpad/@y").Value); short destx = Int16.Parse(xmlNode.SelectSingleNode("target/@x").Value); short desty = Int16.Parse(xmlNode.SelectSingleNode("target/@y").Value); ClusteredMap destmap = GetMapByName(xmlNode.SelectSingleNode("target/@map").Value); return new TeleportPadNode(map, x, y, padx, pady, destmap, destx, desty); } case "UseTeleportNode": { short objid = Int16.Parse(xmlNode.SelectSingleNode("use_object/@id").Value); short destx = Int16.Parse(xmlNode.SelectSingleNode("target/@x").Value); short desty = Int16.Parse(xmlNode.SelectSingleNode("target/@y").Value); ClusteredMap destmap = GetMapByName(xmlNode.SelectSingleNode("target/@map").Value); return new UseTeleportNode(map, x, y, objid, -1, destmap, destx, desty); } } }