using System.Collections; using System.Collections.Generic; using UnityEngine; using Newtonsoft; using Newtonsoft.Json; using System; namespace DataTools { [Serializable] public class Progress { [SerializeField] [JsonProperty] private int chapter; [SerializeField] [JsonProperty] private int action; [SerializeField] [JsonProperty] private int quest; [SerializeField] [JsonProperty] private string questId; [SerializeField] [JsonProperty] private string location; [SerializeField] [JsonProperty] private bool timeUnfinished = false; [SerializeField] [JsonProperty] private int currentConversationIndex = 0; [SerializeField] [JsonProperty] private int assitanceIndex = 0; [Header("GIGS PLAYED")] [SerializeField] [JsonProperty] private List gigsPlayed = new List(); // Should be loaded from firebase [JsonProperty] [SerializeField] private int highestMilestone; public Progress(int chapter, int quest, int action, string location, int hMilestone = 500) { this.chapter = chapter; this.quest = quest; this.action = action; this.location = location; this.gigsPlayed.Clear(); this.highestMilestone = hMilestone; } [JsonIgnore] public int AssitanceIndex { get { return assitanceIndex; } set { assitanceIndex = value; } } [JsonIgnore] public int CurrentConversationIndex { get { return currentConversationIndex; } set { currentConversationIndex = value; } } [JsonIgnore] public bool TimeUnfinished { get { return timeUnfinished; } set { timeUnfinished = value; } } [JsonIgnore] public List GigsPlayed { get { return gigsPlayed; } set { gigsPlayed = value; } } [JsonIgnore] public int Chapter { get { return chapter; } set { chapter = value; } } [JsonIgnore] public string QuestId { get { return questId; } set { questId = value; } } [JsonIgnore] public int Quest { get { return quest; } set { quest = value; } } [JsonIgnore] public int Action { get { return action; } set { action = value; } } [JsonIgnore] public string Location { get { return location; } set { location = value; } } [JsonIgnore] public int HighestMilestone { get { return highestMilestone; } set { highestMilestone = value; } } public void ReachedMilestonePosition(int maxMilestone) { // lower means higher relatively to leader board if (maxMilestone < highestMilestone) highestMilestone = maxMilestone; } } }