| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- using System;
- using System.Collections.Generic;
- [Serializable]
- public class SaveItemCounts
- {
- public int hammer = 1;
- public int moves = 1;
- public int shuffle = 1;
- public int key = 0;
- public int Get(string itemKey)
- {
- switch (itemKey)
- {
- case GameDefinitions.HammerItem: return hammer;
- case GameDefinitions.MovesItem: return moves;
- case GameDefinitions.ShuffleItem: return shuffle;
- case GameDefinitions.KeyItem: return key;
- default: return 0;
- }
- }
- public void Add(string itemKey, int amount)
- {
- switch (itemKey)
- {
- case GameDefinitions.HammerItem: hammer += amount; break;
- case GameDefinitions.MovesItem: moves += amount; break;
- case GameDefinitions.ShuffleItem: shuffle += amount; break;
- case GameDefinitions.KeyItem: key += amount; break;
- }
- }
- }
- [Serializable]
- public class SaveModeClears
- {
- public int classic;
- public int rush;
- public int sealedLevels;
- public int Get(string modeKey)
- {
- switch (modeKey)
- {
- case GameDefinitions.ClassicMode: return classic;
- case GameDefinitions.RushMode: return rush;
- case GameDefinitions.SealedMode: return sealedLevels;
- default: return 0;
- }
- }
- public void Set(string modeKey, int value)
- {
- value = Math.Max(0, Math.Min(GameDefinitions.MaxLevel, value));
- switch (modeKey)
- {
- case GameDefinitions.ClassicMode: classic = value; break;
- case GameDefinitions.RushMode: rush = value; break;
- case GameDefinitions.SealedMode: sealedLevels = value; break;
- }
- }
- public int Total()
- {
- return classic + rush + sealedLevels;
- }
- }
- [Serializable]
- public class SaveCheckInState
- {
- public int day = 1;
- public string last = "";
- }
- [Serializable]
- public class SaveLotteryState
- {
- public string last = "";
- }
- [Serializable]
- public class SavePlayerState
- {
- public string name = "LuckyPlayer";
- public string id = "";
- public int avatar = 1;
- }
- [Serializable]
- public class SavePlayerStats
- {
- public int clears;
- public int served;
- public int best;
- public int earned;
- }
- [Serializable]
- public class SaveSettings
- {
- public bool bgm = true;
- public bool sfx = true;
- public bool reduceMotion;
- public string localeId = "en";
- }
- [Serializable]
- public class SaveAdState
- {
- public string reviveDate = "";
- public int reviveCount;
- }
- [Serializable]
- public class LedgerEntry
- {
- public string type;
- public string note;
- public int amount;
- public string time;
- }
- [Serializable]
- public class GameSaveData
- {
- public int version = 1;
- public int coins = GameDefinitions.DefaultCoins;
- public SaveItemCounts items = new SaveItemCounts();
- public SaveModeClears cleared = new SaveModeClears();
- public SaveCheckInState checkin = new SaveCheckInState();
- public SaveLotteryState lottery = new SaveLotteryState();
- public int tickets;
- public string selectedMode = GameDefinitions.ClassicMode;
- public SavePlayerState player = new SavePlayerState();
- public SavePlayerStats stats = new SavePlayerStats();
- public SaveSettings settings = new SaveSettings();
- public SaveAdState ads = new SaveAdState();
- public int tut;
- public int story;
- public List<LedgerEntry> ledger = new List<LedgerEntry>();
- }
|