/// <summary> /// Fetches the BF2 map into an object. If the map has already been loaded /// into an object previously, that object will be returned instead. /// </summary> /// <param name="Name">The map FOLDER name</param> /// <returns></returns> public BF2Map LoadMap(string Name) { // Check 2 things, 1, does the map exist, and 2, if we have loaded it already if (!Levels.Contains(Name)) { throw new ArgumentException("Level Not Found"); } else if (LoadedLevels.ContainsKey(Name)) { return(LoadedLevels[Name]); } // Create a new instance of the map, and store it for later BF2Map Map = new BF2Map(Name, LevelsPath); LoadedLevels.Add(Name, Map); return(Map); }
/// <summary> /// Fetches the BF2 map into an object. If the map has already been loaded /// into an object previously, that object will be returned instead. /// </summary> /// <param name="Name">The map FOLDER name</param> /// <returns></returns> public BF2Map LoadMap(string Name) { // Check 2 things, 1, does the map exist, and 2, if we have loaded it already if (!Levels.Contains(Name)) throw new ArgumentException("Level Not Found"); else if (LoadedLevels.ContainsKey(Name)) return LoadedLevels[Name]; // Create a new instance of the map, and store it for later BF2Map Map = new BF2Map(Name, LevelsPath); LoadedLevels.Add(Name, Map); return Map; }