public bool AddMap(string name, LevelMap level) { if (maps.ContainsKey(name)) { return(false); } level.Name = name; maps.Add(name, level); return(true); }
public bool SetName(LevelMap map, string name) { if (maps.ContainsKey(name)) { return(false); } LevelMap temp = map; maps.Remove(map.Name); AddMap(name, temp); return(true); }
public void SetNeighbors(LevelMap map, List <string> neighbors) { for (int i = 0; i < map.Neighbors.Count; i++) { if (this[map.Neighbors[i]].Neighbors.Contains(map.Name) && !neighbors.Contains(map.Name)) { this[neighbors[i]].Neighbors.Remove(map.Name); } } for (int i = 0; i < neighbors.Count; i++) { if (!this[neighbors[i]].Neighbors.Contains(map.Name)) { this[neighbors[i]].Neighbors.Add(map.Name); } } map.Neighbors = neighbors; }