Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }