Files
MVP1/Assets/Scripts/Meta/Core/ProgressData.cs
T

126 lines
3.9 KiB
C#

using System;
using System.Collections.Generic;
// Всё, что сохраняется в progress.json (отдельно от save.json с ресурсами и зданиями).
// JsonUtility умеет: числа, строки, bool, массивы, List<> из [Serializable]-классов.
[Serializable]
public class MailItem
{
public int id;
public string title;
public string body;
public long sentTicks;
public bool read;
public bool claimed;
public List<RewardItem> rewards = new List<RewardItem>();
public bool HasRewards { get { return rewards != null && rewards.Count > 0; } }
}
[Serializable]
public class TrainingOrder
{
public int troopIndex;
public int count;
public long startTicks;
public long endTicks;
}
[Serializable]
public class ArenaOpponent
{
public string name;
public int power;
public int rating;
}
[Serializable]
public class ProgressData
{
// --- Профиль ---
public string playerName = "Командир";
public string playerId = "";
public int avatarIndex = 0;
public int level = 1;
public int xp = 0;
public long firstLaunchTicks = 0;
public int daysPlayed = 0;
public int lastLoginDay = -1;
// --- Настройки ---
public float musicVolume = 0.8f;
public float soundVolume = 0.8f;
public bool vibration = true;
public bool notifications = true;
public int quality = 1; // 0 низкое, 1 среднее, 2 высокое
public bool fps60 = true;
// --- Статистика (для профиля и заданий) ---
public float[] collected = new float[8]; // индекс = (int)ResourceType
public int battlesWon;
public int battlesLost;
public int troopsTrained;
public int arenaFights;
public int arenaWins;
public int questsDone;
// --- Задания ---
public List<string> claimedQuests = new List<string>();
public int dailyDay = -1;
public List<string> claimedDaily = new List<string>();
public float[] dailyCollected = new float[8];
public int dailyBattles;
public int dailyTroops;
public int dailyArena;
public int dailyMarches;
// --- Награда за вход ---
public int loginRewardIndex = 0; // какой день из 7 следующий
public int lastLoginRewardDay = -1;
// --- Почта ---
public List<MailItem> mail = new List<MailItem>();
public int nextMailId = 1;
public bool starterMailSent;
// --- Магазин ---
public int shopDay = -1;
public List<string> shopIds = new List<string>();
public List<int> shopCounts = new List<int>();
// --- Герой ---
public int heroLevel = 1;
// --- Войска ---
public int[] troops = new int[4];
public List<TrainingOrder> training = new List<TrainingOrder>();
// --- Бой (кампания) ---
public int battleStage = 1;
// --- Арена ---
public int arenaRating = 1000;
public int arenaTickets = 5;
public long arenaTicketTicks = 0;
public List<ArenaOpponent> arenaOpponents = new List<ArenaOpponent>();
// --- Глобальная карта ---
public List<SettlementState> settlements = new List<SettlementState>();
public List<WorldMarch> marches = new List<WorldMarch>();
public List<BattleReport> reports = new List<BattleReport>();
public int nextMarchId = 1;
public int marchesSent;
public int worldWins;
public int worldLosses;
// --- Большая карта мира (сцена WorldMap, код Саши) ---
public List<Bogatyri.World.MarchData> sashaMarches = new List<Bogatyri.World.MarchData>();
public List<ArmyBridge.MarchUnits> sashaMarchUnits = new List<ArmyBridge.MarchUnits>();
// --- Событие ---
public int eventWeek = -1;
public int eventPoints;
public int eventTroopRemainder;
public List<int> eventClaimed = new List<int>();
}