public static XmlDocument SaveGameToDoc() { SaveCompression.doSaveCompression = true; try { ScribeUtil.StartWritingToDoc(); Scribe.EnterNode("savegame"); ScribeMetaHeaderUtility.WriteMetaHeader(); Scribe.EnterNode("game"); int currentMapIndex = Current.Game.currentMapIndex; Scribe_Values.Look(ref currentMapIndex, "currentMapIndex", -1); Current.Game.ExposeSmallComponents(); World world = Current.Game.World; Scribe_Deep.Look(ref world, "world"); List <Map> maps = Find.Maps; Scribe_Collections.Look(ref maps, "maps", LookMode.Deep); Find.CameraDriver.Expose(); Scribe.ExitNode(); } finally { SaveCompression.doSaveCompression = false; } return(ScribeUtil.FinishWritingToDoc()); }