using System.Collections.Generic; using System; using UnityEngine; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace DataTools { public enum GigType { Commerical, Sponsered, Photoshoot, FashionShow, GoSee, CastingCall, Interviews, Practice } [Serializable] public class Gig : DataObject { [JsonProperty] [SerializeField] private int duration; [JsonProperty] [SerializeField] private string location; [JsonProperty] [SerializeField] private string description; [JsonProperty] [SerializeField] private List actions; [JsonProperty] [SerializeField] private Currency currency; [JsonProperty] [SerializeField] private Chirp chirp; [JsonProperty] [SerializeField] private string conversation; [JsonProperty] [SerializeField] [JsonConverter(typeof(StringEnumConverter))] private GigType type; [JsonProperty] [SerializeField] private int starsNeeded; [JsonProperty] [SerializeField] private int starsEarned; public Gig(int duration, string location, List actions, Currency currency, Chirp chirp, string ConversationId, GigType gigtype, int starsNeeded, string Title) { this.duration = duration; this.location = location; this.actions = actions; this.currency = currency; this.chirp = chirp; this.conversation = ConversationId; this.type = gigtype; this.starsNeeded = starsNeeded; this.description = Title; } [JsonIgnore] public string Description { get { return description; } set { description = value; } } [JsonIgnore] public int Duration { get { return duration; } set { duration = value; } } [JsonIgnore] public string Location { get { return location; } set { location = value; } } [JsonIgnore] public List Actions { get { return actions; } set { actions = value; } } [JsonIgnore] public Currency Currency { get { return currency; } set { currency = value; } } [JsonIgnore] public Chirp Chirp { get { return chirp; } set { chirp = value; } } [JsonIgnore] public string Conversation { get { return conversation; } set { conversation = value; } } [JsonIgnore] public GigType Type { get { return type; } set { type = value; } } [JsonIgnore] public int StarsEarned { get { return starsEarned; } set { starsEarned = value; } } [JsonIgnore] public int StarsNeeded { get { return starsNeeded; } set { starsNeeded = value; } } public int GetTotalStars() { int stars = 0; foreach (GigAction action in actions) { stars += action.Stars; } return stars; } } }