SaveHouse() public method

public SaveHouse ( VM vm, string path ) : void
vm VM
path string
return void
Esempio n. 1
0
        private void SaveHouseButton_OnButtonClick(UIElement button)
        {
            if (vm == null) return;

            var exporter = new VMWorldExporter();
            exporter.SaveHouse(vm, GameFacade.GameFilePath("housedata/blueprints/house_00.xml"));
            var marshal = vm.Save();
            Directory.CreateDirectory(Path.Combine(FSOEnvironment.UserDir, "LocalHouse/"));
            using (var output = new FileStream(Path.Combine(FSOEnvironment.UserDir, "LocalHouse/house_00.fsov"), FileMode.Create))
            {
                marshal.SerializeInto(new BinaryWriter(output));
            }
            if (vm.GlobalLink != null) ((VMTSOGlobalLinkStub)vm.GlobalLink).Database.Save();
        }
Esempio n. 2
0
        public void SaveLot()
        {
            string filename = Path.GetFileName(Settings.Default.DebugLot);
            var exporter = new VMWorldExporter();
            exporter.SaveHouse(state, Path.Combine(Settings.Default.GamePath + "housedata/blueprints/" + filename));

            var marshal = state.Save();
            Directory.CreateDirectory("Content/LocalHouse/");
            var extensionless = filename.Substring(0, filename.Length - 4);

            //backup old state
            try { File.Copy("Content/LocalHouse/" + extensionless + ".fsov", "Content/LocalHouse/" + extensionless + "_backup.fsov", true); }
            catch (Exception) { }

            using (var output = new FileStream("Content/LocalHouse/"+extensionless+".fsov", FileMode.Create))
            {
                marshal.SerializeInto(new BinaryWriter(output));
            }

            ((VMTSOGlobalLinkStub)state.GlobalLink).Database.Save();
        }
Esempio n. 3
0
        private void SaveHouseButton_OnButtonClick(UIElement button)
        {
            if (vm == null) return;

            var exporter = new VMWorldExporter();
            exporter.SaveHouse(vm, GameFacade.GameFilePath("housedata/blueprints/house_00.xml"));
        }