コード例 #1
0
ファイル: MainController.cs プロジェクト: arpond/longRoadHome
        private void ClearSaveData()
        {
            bool           saveSucessful = true;
            FileReadWriter frw           = new FileReadWriter();

            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.PLAYER_CHARACTER, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.INVENTORY, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.USED_EVENTS, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.CURRENT_EVENT, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.VISITED, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.UNVISISTED, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.CURRENT_LOCATION, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.CURRENT_SUBLOCATION, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.DIFFICULTY_CONTROLLER, "");
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.BUTTONS_AREA, "");
        }
コード例 #2
0
ファイル: MainController.cs プロジェクト: arpond/longRoadHome
        /// <summary>
        /// Writes Save Data to files
        /// </summary>
        /// <returns>If the save data was written sucessfully</returns>
        public bool WriteSaveData()
        {
            bool           saveSucessful = true;
            FileReadWriter frw           = new FileReadWriter();

            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.DISCOVERED, gs.ParseDiscoveredToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.PLAYER_CHARACTER, gs.ParsePCToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.INVENTORY, gs.ParseInventoryToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.USED_EVENTS, gs.ParseUsedEventsToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.CURRENT_EVENT, gs.ParseCurrentEventToString());

            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.VISITED, gs.ParseVisitedToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.UNVISISTED, gs.ParseUnvisitedToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.CURRENT_LOCATION, gs.ParseCurrLocationToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.CURRENT_SUBLOCATION, gs.ParseCurrSublocationToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.DIFFICULTY_CONTROLLER, dc.ParseToString());
            saveSucessful &= frw.WriteSaveDataFile(FileReadWriter.BUTTONS_AREA, gs.ParseButtonAreasToString());
            saveSucessful &= frw.WriteBitmap(FileReadWriter.WORLD_MAP, gs.GetLM().GetWorldMap());

            return(saveSucessful);
        }