コード例 #1
0
ファイル: FileControler.cs プロジェクト: lvendrame/p-atack
        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());
        }
コード例 #2
0
ファイル: FileControler.cs プロジェクト: lvendrame/p-atack
        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();
        }