| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- 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
- };
- }
- }
|