public void CopyMapDataFrom(XleMap map) { InitializeMap(map.Width, map.Height); for (int j = 0; j < map.Height; j++) { for (int i = 0; i < map.Width; i++) { this[i, j] = map[i, j]; } } }
public static void SaveMap(XleMap map, string filename) { if (System.IO.Path.GetExtension(filename).ToLower() == ".xmf") { XleSerializer ser = new XleSerializer(typeof(XleMap)); using (System.IO.Stream file = System.IO.File.Open(filename, System.IO.FileMode.Create, System.IO.FileAccess.Write)) { ser.Serialize(file, map); } } }