static SaveFile BuildSave() { PreSave?.Invoke(); SaveFile save = new SaveFile { version = Migrations.version, gameTime = GameTime.save, currency = CurrencySystem.instance.save, conveyor = ConveyorSystem.instance.save, machine = MachineSystem.instance.save, tileSelection = TileSelectionManager.instance.save, overviewCameraController = OverviewCameraController.instance.save, analytics = Analytics.instance.save, }; BackgroundMusic.instance.GetSave(out save.backgroundMusic); InterfaceSelectionManager.instance.GetSave(out save.interfaceSelection); MachineGroupAchievements.instance.GetSave(out save.machineGroupAchievements); MachineUnlockSystem.instance.GetSave(out save.machineUnlocks); ProgressionStore.instance.GetSave(out save.progressionSystem); SpacePlatform.GetSave(out save.spacePlatforms); PostSave?.Invoke(); return(save); }
public JsonResult DeletePostSaved(int?id) { PostSave postSave = db.PostSaves.FirstOrDefault(s => s.Id == id); db.PostSaves.Remove(postSave); db.SaveChanges(); return(Json(1, JsonRequestBehavior.AllowGet)); }
public ActionResult CreatePostSaved(int id) { var userName = Session["userName"] as string; User user = db.Users.FirstOrDefault(us => us.UserName.Equals(userName)); PostSave postSave = new PostSave { PostId = id, UserId = user.Id }; db.PostSaves.Add(postSave); db.SaveChanges(); return(Json(1, JsonRequestBehavior.AllowGet)); }