コード例 #1
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public MapNode(ClusteredMap map, Vertex2D location)
 {
     this.map = map;
     this.location = location;
 }
コード例 #2
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public MapNode(ClusteredMap map, short x, short y)
 {
     this.map = map;
     this.location = new Vertex2D(x, y);
 }
コード例 #3
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public UseTeleportNode(ClusteredMap map, Vertex2D location, MapNode target, short useObject, short useWithObject)
     : base(map, location, target)
 {
     this.useObject = useObject;
     this.useWithObject = useWithObject;
 }
コード例 #4
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 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;
 }
コード例 #5
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public TeleportPadNode(ClusteredMap map, Vertex2D location, MapNode target, Vertex2D padLocation)
     : base(map, location, target)
 {
     this.padLocation = padLocation;
 }
コード例 #6
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 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);
 }
コード例 #7
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 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);
 }
コード例 #8
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public BeamMeNode(ClusteredMap map, short x, short y, ClusteredMap destMap, short destX, short destY)
     : base(map, x, y, destMap, destX, destY)
 {
 }
コード例 #9
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public POINode(ClusteredMap map, short x, short y)
     : base(map, x, y)
 {
 }
コード例 #10
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public TeleportNode(ClusteredMap map, Vertex2D location, MapNode target)
     : base(map, location)
 {
     this.target = target;
 }
コード例 #11
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public POINode(ClusteredMap map, Vertex2D location)
     : base(map, location)
 {
 }
コード例 #12
0
ファイル: MapNodes.cs プロジェクト: ago1024/ElTools
 public BeamMeNode(ClusteredMap map, Vertex2D location, MapNode target)
     : base(map, location, target)
 {
 }
コード例 #13
0
ファイル: Program.cs プロジェクト: ago1024/ElTools
 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;
 }
コード例 #14
0
ファイル: MapManager.cs プロジェクト: ago1024/ElTools
        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;
        }
コード例 #15
0
ファイル: GlobalPathFinder.cs プロジェクト: ago1024/ElTools
 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);
             }
     }
 }