using System; using System.Collections.Generic; using UnityEngine; namespace TKS.OutGame { // 세이브 C 단계(PD #1093 C · 기획서 §11 "training" · "patrol" · "dev" · "counters" · inv "chests" · "treasures" + 연무장) — SaveData 의 필드. [Serializable] public class TrainState { [Tooltip("unit_type 키(infantry …)")] public string type; public int rank = 1; [Tooltip("hp · atk · def 항목 Lv(0 = 훈련 안 함)")] public int[] lv = { 0, 0, 0 }; [Tooltip("훈련 지휘관 = 파견한 영웅 id(그 병종 영웅 · \"\" = 없음 · PD 2026-11-12 · 장면 표시만)")] public string commander = ""; } [Serializable] public class PatrolState { [Tooltip("누적 시작 시각(UTC ISO · 마지막 수확)")] public string startAt = ""; [Tooltip("수확 소수점 이월(장비 · 상자 · 결정적 누적)")] public float carryGear; public float carryChest; [Tooltip("순찰 파견 영웅 id(\"\" = 없음 · PD 2026-11-12 · 장면 표시만)")] public string hero = ""; } [Serializable] public class DevState { public List nodes = new List(); [Tooltip("지금 트리에 쓴 도면(초기화 환급)")] public int blueprintSpent; [Tooltip("개발 배치 영웅 id(\"\" = 없음 · PD 2026-11-12 · 장면 표시만)")] public string hero = ""; } [Serializable] public class TreasureState { public string id; [Tooltip("강화 ★(획득 = 0)")] public int star; public int shards; } /// 투기장 상대 편성 1칸(서버 모드 = 실제 유저의 방어 편성 · 레벨 · 등급 · ★ 이 칸마다 다르다). [Serializable] public class ArenaUnit { public string id = ""; public int lv = 1; [Tooltip("승급 등급(병사 = \"\")")] public string grade = ""; [Tooltip("★(병사 = 0)")] public int star; } [Serializable] public class ArenaSample { public string name = ""; public List heroes = new List(); public int lv = 1; public int score; [Tooltip("칸마다의 강함(서버 모드 · 비어 있으면 heroes + lv 로 만든다)")] public List units = new List(); } [Serializable] public class ArenaState { [Tooltip("천하제일 탑 = 클리어한 최고 층")] public int towerFloor; public int towerTickets; public int medals; public int seasonScore; [Tooltip("시즌 시작(UTC ISO) · season_days 지나면 순위 보상 후 새 시즌")] public string seasonStart = ""; public int wins; public int losses; public List samples = new List(); [Tooltip("지난 시즌 순위·보상(표시)")] public string lastSeason = ""; [Tooltip("적장 토벌 주(yyyy-ww) · 바뀌면 누적 피해 초기화")] public string raidWeek = ""; public int raidDamage; public string raidBoss = ""; [Tooltip("서버 모드 = 시즌 · 상대 · 이번 주 보스 · 순위를 서버가 정한다(기기 규칙이 따로 굴리지 않는다)")] public bool server; [Tooltip("서버가 준 이번 시즌 내 순위 · 순위 인원(서버 모드)")] public int rank; public int rankTotal; [Tooltip("서버가 준 주간 랭킹 정산 시간(UTC ISO · 지금 진행 중이거나 다음에 올 것 · 없으면 \"\") — 이 동안 settleContents 의 컨텐츠를 쓸 수 없다")] public string settleStart = ""; public string settleEnd = ""; [Tooltip("정산 동안 쓸 수 없는 컨텐츠(연무장 종류 낱말 — arena · raid · tower)")] public List settleContents = new List(); } /// C 단계 일일 횟수(날짜가 바뀌면 통째로 새로) — 던전 · 투기장 · 적장 · 순찰 즉시 수확 · 탑 광고 · 상점 무료 새로고침 · 투기장 상점. [Serializable] public class DailyC { public string day = ""; public List dungeons = new List(); public int arena; public int raid; public int towerAd; public int freeRefresh; public int arenaShop; public int Dungeon(string id) { foreach (var c in dungeons) if (c.id == id) return c.n; return 0; } public void AddDungeon(string id) { foreach (var c in dungeons) if (c.id == id) { c.n++; return; } dungeons.Add(new CountEntry { id = id, n = 1 }); } } /// CountEntry 목록 도우미(카운터 · 상자 · 개발 노드). public static class Counts { public static int Get(List l, string id) { if (l == null) return 0; foreach (var c in l) if (c.id == id) return c.n; return 0; } public static void Add(List l, string id, int n) { foreach (var c in l) if (c.id == id) { c.n = Mathf.Max(0, c.n + n); return; } if (n > 0) l.Add(new CountEntry { id = id, n = n }); } public static void Set(List l, string id, int n) { foreach (var c in l) if (c.id == id) { c.n = n; return; } l.Add(new CountEntry { id = id, n = n }); } } }