//Returns null if didn't find public static Map GetMapByName(string name) { Map toReturn = null; foreach (var map in mapCache) { if (map.mapName.Equals(name)) { toReturn = map; break; } } if (toReturn != null) { toReturn = toReturn.Clone(true); } return(toReturn); }
public static void AddMap(Map map) { mapCache.Add(map.Clone(true)); }