예제 #1
0
        private void LoadNewWdtMap(object sender, EventArgs e)
        {
            var view            = (ITileSelectionView)sender;
            var wdt             = _service.Files.GetWdt(MpqFilePaths.MapToInternalName(view.Continent));
            var tileCoordinates = (from x in WdtCoordinateRange
                                   from y in WdtCoordinateRange
                                   where wdt.AdtExistsForTile(x, y)
                                   select new Vector2(x, y)).ToArray();
            var topLeft     = new Vector2(tileCoordinates.Min(t => t.X), tileCoordinates.Min(t => t.Y));
            var bottomRight = new Vector2(tileCoordinates.Max(t => t.X), tileCoordinates.Max(t => t.Y));

            view.DisplayTiles(tileCoordinates, topLeft, bottomRight);
        }
예제 #2
0
 public Adt GetAdt(string continent, int x, int y)
 {
     return(TryGetOrCreate(_adtCache, Tuple.Create(continent, x, y), t =>
     {
         var files = MpqFilePaths.GetRelevantAdtFileNames(continent, x, y);
         var adt = new Adt(_reader.Read(files.First()));
         foreach (var secondaryFile in files.Skip(1))
         {
             adt.ParseSecondaryData(_reader.Read(secondaryFile));
         }
         return adt;
     }));
 }
예제 #3
0
 public void LoadTile(WowContinent continent, int x, int y)
 {
     Scene   = _builder.BuildTile(MpqFilePaths.MapToInternalName(continent), x, y);
     BVHTree = new BVHTree(
         Scene.Terrain
         .Concat(Scene.Liquids)
         .Concat(Scene.Doodads)
         .Concat(Scene.Wmos));
     BuildResult = null;
     if (CurrentNavigationMeshRenderer != null)
     {
         CurrentNavigationMeshRenderer.ClearCache();
     }
     TileLoaded(this, EventArgs.Empty);
 }
예제 #4
0
        static void Main(string[] args)
        {
            if (args.Length != 3)
            {
                Usage();
                return;
            }

            WowContinent cont;
            var          continent = args[0];

            if (!Enum.TryParse(continent, out cont))
            {
                Console.Error.WriteLine("Continent '" + continent + "' not supported. Please try another or add the respective enum member.");
                return;
            }
            var x     = int.Parse(args[1]);
            var y     = int.Parse(args[2]);
            var scene = Builder.BuildTile(MpqFilePaths.MapToInternalName(cont), x, y);

            Dumper(scene, Console.OpenStandardOutput(65536));
        }
예제 #5
0
 public Wdt GetWdt(string continent)
 {
     return(TryGetOrCreate(_wdtCache, continent, c => new Wdt(_reader.Read(MpqFilePaths.GetWdtFileName(c)))));
 }