Gig.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. using System.Collections.Generic;
  2. using System;
  3. using UnityEngine;
  4. using Newtonsoft.Json;
  5. using Newtonsoft.Json.Converters;
  6. namespace DataTools
  7. {
  8. public enum GigType
  9. {
  10. Commerical,
  11. Sponsered,
  12. Photoshoot,
  13. FashionShow,
  14. GoSee,
  15. CastingCall,
  16. Interviews,
  17. Practice
  18. }
  19. [Serializable]
  20. public class Gig : DataObject
  21. {
  22. [JsonProperty]
  23. [SerializeField] private int duration;
  24. [JsonProperty]
  25. [SerializeField] private string location;
  26. [JsonProperty]
  27. [SerializeField] private string description;
  28. [JsonProperty]
  29. [SerializeField] private List<GigAction> actions;
  30. [JsonProperty]
  31. [SerializeField] private Currency currency;
  32. [JsonProperty]
  33. [SerializeField] private Chirp chirp;
  34. [JsonProperty]
  35. [SerializeField] private string conversation;
  36. [JsonProperty]
  37. [SerializeField]
  38. [JsonConverter(typeof(StringEnumConverter))]
  39. private GigType type;
  40. [JsonProperty]
  41. [SerializeField] private int starsNeeded;
  42. [JsonProperty]
  43. [SerializeField] private int starsEarned;
  44. public Gig(int duration, string location, List<GigAction> actions, Currency currency,
  45. Chirp chirp, string ConversationId, GigType gigtype, int starsNeeded, string Title)
  46. {
  47. this.duration = duration;
  48. this.location = location;
  49. this.actions = actions;
  50. this.currency = currency;
  51. this.chirp = chirp;
  52. this.conversation = ConversationId;
  53. this.type = gigtype;
  54. this.starsNeeded = starsNeeded;
  55. this.description = Title;
  56. }
  57. [JsonIgnore]
  58. public string Description
  59. {
  60. get
  61. {
  62. return description;
  63. }
  64. set
  65. {
  66. description = value;
  67. }
  68. }
  69. [JsonIgnore]
  70. public int Duration
  71. {
  72. get
  73. {
  74. return duration;
  75. }
  76. set
  77. {
  78. duration = value;
  79. }
  80. }
  81. [JsonIgnore]
  82. public string Location
  83. {
  84. get
  85. {
  86. return location;
  87. }
  88. set
  89. {
  90. location = value;
  91. }
  92. }
  93. [JsonIgnore]
  94. public List<GigAction> Actions
  95. {
  96. get
  97. {
  98. return actions;
  99. }
  100. set
  101. {
  102. actions = value;
  103. }
  104. }
  105. [JsonIgnore]
  106. public Currency Currency
  107. {
  108. get
  109. {
  110. return currency;
  111. }
  112. set
  113. {
  114. currency = value;
  115. }
  116. }
  117. [JsonIgnore]
  118. public Chirp Chirp
  119. {
  120. get
  121. {
  122. return chirp;
  123. }
  124. set
  125. {
  126. chirp = value;
  127. }
  128. }
  129. [JsonIgnore]
  130. public string Conversation
  131. {
  132. get
  133. {
  134. return conversation;
  135. }
  136. set
  137. {
  138. conversation = value;
  139. }
  140. }
  141. [JsonIgnore]
  142. public GigType Type
  143. {
  144. get
  145. {
  146. return type;
  147. }
  148. set
  149. {
  150. type = value;
  151. }
  152. }
  153. [JsonIgnore]
  154. public int StarsEarned
  155. {
  156. get
  157. {
  158. return starsEarned;
  159. }
  160. set
  161. {
  162. starsEarned = value;
  163. }
  164. }
  165. [JsonIgnore]
  166. public int StarsNeeded
  167. {
  168. get
  169. {
  170. return starsNeeded;
  171. }
  172. set
  173. {
  174. starsNeeded = value;
  175. }
  176. }
  177. public int GetTotalStars()
  178. {
  179. int stars = 0;
  180. foreach (GigAction action in actions)
  181. {
  182. stars += action.Stars;
  183. }
  184. return stars;
  185. }
  186. }
  187. }