CEngineSharp_Editor.MapEditor.LoadMaps C# (CSharp) Method

LoadMaps() private method

private LoadMaps ( ) : void
return void
        private void LoadMaps()
        {
            DirectoryInfo dI = new DirectoryInfo(dataPath + "/Maps/");

            this.maps = new List<Map>();

            this.mapList.Items.Clear();

            foreach (var file in dI.GetFiles("*.map", SearchOption.TopDirectoryOnly))
            {
                Map map = Map.LoadMap(file.FullName, mapRenderer.TileSetTextures);

                this.maps.Add(map);
                this.mapList.Items.Add(map.Name);
            }

            if (this.maps.Count != 0)
                this.mapEditorProperties.CurrentMap = this.maps[0];
            else
            {
                this.mapEditorProperties.CurrentMap = new Map();
                this.mapEditorProperties.CurrentMap.ResizeMap(25, 25);
                this.mapEditorProperties.CurrentMap.Name = "Untitled";
                this.maps.Add(this.mapEditorProperties.CurrentMap);
                this.mapList.Items.Add(this.mapEditorProperties.CurrentMap.Name);
                this.mapList.SelectedIndex = 0;
            }
        }