public MapTools(string MapsPath = null) { //fabrication d'un bitmap b = new Bitmap(930, 742); //création de l'outil de dessin g = Graphics.FromImage(b); string FullPath = null; if (MapsPath != null) { FullPath = Path.Combine(Application.StartupPath, MapsPath); if (!Directory.Exists(FullPath)) FullPath = null; } string RelPath = "/data/content/maps"; for (int i = 0; i <= 5; i++) { FullPath = Application.StartupPath + RelPath; if (Directory.Exists(FullPath)) break; FullPath = null; RelPath = "/.." + RelPath; } if (FullPath == null) throw new FileNotFoundException("The directory with Map data can't be found"); mapMngr = new MapDataManager(FullPath, false); mapMngr.statItem = new CellStats(); OpenMap(null); }
public MapTools(string MapsPath = null) { //fabrication d'un bitmap b = new Bitmap(930, 742); //création de l'outil de dessin g = Graphics.FromImage(b); string FullPath = null; if (MapsPath != null) { FullPath = Path.Combine(Application.StartupPath, MapsPath); if (!Directory.Exists(FullPath)) { FullPath = null; } } string RelPath = "/data/content/maps"; for (int i = 0; i <= 5; i++) { FullPath = Application.StartupPath + RelPath; if (Directory.Exists(FullPath)) { break; } FullPath = null; RelPath = "/.." + RelPath; } if (FullPath == null) { throw new FileNotFoundException("The directory with Map data can't be found"); } mapMngr = new MapDataManager(FullPath, false); mapMngr.statItem = new CellStats(); OpenMap(null); }