private void SaveGame() { mDirector.GetStoryManager.SaveAchievements(); var saveName = DateTime.Now; XSerializer.Save(mDirector.GetStoryManager.Level, saveName.ToString(CultureInfo.CurrentCulture).Replace(':', '_') + ".xml", false); Console.WriteLine("Game Saved"); sSaved = true; }
public bool KeyTyped(KeyEvent keyevent) { // b key is used to convert the settler unit into a command center var keyArray = keyevent.CurrentKeys; foreach (var key in keyArray) { // if key b has been pressed and the settler unit is selected and its not moving // --> send out event that deletes settler and adds a command center if (key == Keys.Q) { mDirector.GetStoryManager.SaveAchievements(); XSerializer.Save(this, "Quicksave.xml", false); return(false); } } return(true); }
internal void SaveConfig() { GetGlobalVariablesInstance.UpdateFromStatic(); XSerializer.Save(GetGlobalVariablesInstance, @"Config.xml", true); }
/// <summary> /// The Method to save the Achievements. The Achievements file will be saved to %USERPROFILE%\Saved Games\Singularity\Achievements. If no such directory /// exists it will create a new one. You want to call this method before serializing everything. /// </summary> internal void SaveAchievements() { mAchievements.UpdateFromStatic(); XSerializer.Save(mAchievements, @"Achievements.xml", true); }