Progress.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Newtonsoft;
  5. using Newtonsoft.Json;
  6. using System;
  7. namespace DataTools
  8. {
  9. [Serializable]
  10. public class Progress
  11. {
  12. [SerializeField]
  13. [JsonProperty]
  14. private int chapter;
  15. [SerializeField]
  16. [JsonProperty]
  17. private int action;
  18. [SerializeField]
  19. [JsonProperty]
  20. private int quest;
  21. [SerializeField]
  22. [JsonProperty]
  23. private string questId;
  24. [SerializeField]
  25. [JsonProperty]
  26. private string location;
  27. [SerializeField]
  28. [JsonProperty]
  29. private bool timeUnfinished = false;
  30. [SerializeField]
  31. [JsonProperty]
  32. private int currentConversationIndex = 0;
  33. [SerializeField]
  34. [JsonProperty]
  35. private int assitanceIndex = 0;
  36. [Header("GIGS PLAYED")]
  37. [SerializeField]
  38. [JsonProperty]
  39. private List<Gig> gigsPlayed = new List<Gig>();
  40. // Should be loaded from firebase
  41. [JsonProperty]
  42. [SerializeField]
  43. private int highestMilestone;
  44. public Progress(int chapter, int quest, int action, string location, int hMilestone = 500)
  45. {
  46. this.chapter = chapter;
  47. this.quest = quest;
  48. this.action = action;
  49. this.location = location;
  50. this.gigsPlayed.Clear();
  51. this.highestMilestone = hMilestone;
  52. }
  53. [JsonIgnore]
  54. public int AssitanceIndex
  55. {
  56. get
  57. {
  58. return assitanceIndex;
  59. }
  60. set
  61. {
  62. assitanceIndex = value;
  63. }
  64. }
  65. [JsonIgnore]
  66. public int CurrentConversationIndex
  67. {
  68. get
  69. {
  70. return currentConversationIndex;
  71. }
  72. set
  73. {
  74. currentConversationIndex = value;
  75. }
  76. }
  77. [JsonIgnore]
  78. public bool TimeUnfinished
  79. {
  80. get
  81. {
  82. return timeUnfinished;
  83. }
  84. set
  85. {
  86. timeUnfinished = value;
  87. }
  88. }
  89. [JsonIgnore]
  90. public List<Gig> GigsPlayed
  91. {
  92. get
  93. {
  94. return gigsPlayed;
  95. }
  96. set
  97. {
  98. gigsPlayed = value;
  99. }
  100. }
  101. [JsonIgnore]
  102. public int Chapter
  103. {
  104. get
  105. {
  106. return chapter;
  107. }
  108. set
  109. {
  110. chapter = value;
  111. }
  112. }
  113. [JsonIgnore]
  114. public string QuestId
  115. {
  116. get
  117. {
  118. return questId;
  119. }
  120. set
  121. {
  122. questId = value;
  123. }
  124. }
  125. [JsonIgnore]
  126. public int Quest
  127. {
  128. get
  129. {
  130. return quest;
  131. }
  132. set
  133. {
  134. quest = value;
  135. }
  136. }
  137. [JsonIgnore]
  138. public int Action
  139. {
  140. get
  141. {
  142. return action;
  143. }
  144. set
  145. {
  146. action = value;
  147. }
  148. }
  149. [JsonIgnore]
  150. public string Location
  151. {
  152. get
  153. {
  154. return location;
  155. }
  156. set
  157. {
  158. location = value;
  159. }
  160. }
  161. [JsonIgnore]
  162. public int HighestMilestone
  163. {
  164. get
  165. {
  166. return highestMilestone;
  167. }
  168. set
  169. {
  170. highestMilestone = value;
  171. }
  172. }
  173. public void ReachedMilestonePosition(int maxMilestone)
  174. {
  175. // lower means higher relatively to leader board
  176. if (maxMilestone < highestMilestone)
  177. highestMilestone = maxMilestone;
  178. }
  179. }
  180. }