using System; using System.Collections.Generic; using System.Text.Json.Serialization; namespace SOTF_Struct.Generic { public class Influence { [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public string TypeId { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public double Sentiment { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public double Anger { get; set; } [JsonIgnore(Condition = JsonIgnoreCondition.Never)] public double Fear { get; set; } public static Influence operator +(Influence a, Influence b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger + b.Anger, Fear = a.Fear + b.Fear, Sentiment = a.Sentiment + b.Sentiment }; public static Influence operator +(Influence a, double b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger + b, Fear = a.Fear + b, Sentiment = a.Sentiment + b }; public static Influence operator +(Influence a, int b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger + b, Fear = a.Fear + b, Sentiment = a.Sentiment + b }; public static Influence operator -(Influence a, Influence b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger - b.Anger, Fear = a.Fear - b.Fear, Sentiment = a.Sentiment - b.Sentiment }; public static Influence operator -(Influence a, double b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger - b, Fear = a.Fear - b, Sentiment = a.Sentiment - b }; public static Influence operator -(Influence a, int b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger - b, Fear = a.Fear - b, Sentiment = a.Sentiment - b }; public static Influence operator *(Influence a, Influence b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger * b.Anger, Fear = a.Fear * b.Fear, Sentiment = a.Sentiment * b.Sentiment }; public static Influence operator *(Influence a, double b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger * b, Fear = a.Fear * b, Sentiment = a.Sentiment * b }; public static Influence operator *(Influence a, int b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger * b, Fear = a.Fear * b, Sentiment = a.Sentiment * b }; public static Influence operator /(Influence a, Influence b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger / b.Anger, Fear = a.Fear / b.Fear, Sentiment = a.Sentiment / b.Sentiment }; public static Influence operator /(Influence a, double b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger / b, Fear = a.Fear / b, Sentiment = a.Sentiment / b }; public static Influence operator /(Influence a, int b) => new Influence() { TypeId = a.TypeId, Anger = a.Anger / b, Fear = a.Fear / b, Sentiment = a.Sentiment / b }; } }