public static MapResponse Open(string pstr_FullPathFileName) { XmlSerializer xSerializer = new XmlSerializer(typeof(MapInformation)); System.IO.StreamReader sReader = new System.IO.StreamReader(pstr_FullPathFileName); MapInformation mrRet = xSerializer.Deserialize(sReader) as MapInformation; sReader.Close(); return(mrRet.ToMapResponse()); }
public static void Save(string pstr_FullPathFileName, MatrixMapCell mtxMapCell, List <Brick> lstBricks, int pint_TileWidth, int pint_TileHeight) { string path = FileControler.GetPath(pstr_FullPathFileName); SaveBricks(lstBricks, path); MapInformation info = new MapInformation(mtxMapCell, lstBricks, pint_TileWidth, pint_TileHeight); XmlSerializer xSerializer = new XmlSerializer(typeof(MapInformation)); System.IO.StreamWriter sWriter = new System.IO.StreamWriter(pstr_FullPathFileName, false); xSerializer.Serialize(sWriter, info); sWriter.Close(); }