CNCMaps.FileFormats.Map.MapFile.ReadTerrain C# (CSharp) Method

ReadTerrain() private method

Reads the terrain.
private ReadTerrain ( ) : void
return void
        private void ReadTerrain()
        {
            IniSection terrainSection = GetSection("Terrain");
            if (terrainSection == null) return;
            foreach (var v in terrainSection.OrderedEntries) {
                int pos;
                if (int.TryParse(v.Key, out pos)) {
                    string name = v.Value;
                    int rx = pos % 1000;
                    int ry = pos / 1000;
                    var t = new Terrain(name);
                    t.Tile = Tiles.GetTileR(rx, ry);
                    if (t.Tile != null)
                        Terrains.Add(t);
                }
            }
            Logger.Debug("Read {0} terrain objects", Terrains.Count);
        }