예제 #1
0
        private void InitialiseWorldTileData()
        {
            var sectorMap = LandscapeLoader.LoadLandscape();

            for (int lvl = 0; lvl < 4; lvl++)
            {
                var wildX = 2304;
                var wildY = 1776 - (lvl * 944);
                for (var sx = 0; sx < 1000; sx += 48)
                {
                    for (var sy = 0; sy < 1000; sy += 48)
                    {
                        var x    = (sx + wildX) / 48;
                        var y    = (sy + (lvl * 944) + wildY) / 48;
                        var bigX = sx;
                        var bigY = sy + (944 * lvl);

                        var sectorName = $"h{lvl}x{x}y{y}";

                        List <Tile> sectorTiles;
                        if (!sectorMap.TryGetValue(sectorName, out sectorTiles))
                        {
                            Debug.Fail($"Sector tile data could not be loaded for sectorName {sectorName}");
                        }

                        InitialiseSectorTileData(sectorTiles, bigX, bigY);
                    }
                }
            }
        }
 public LandscapeLoaderTests()
 {
     SectorMap = LandscapeLoader.LoadLandscape();
 }