using BS.Shared.Interface.Feature.AICore; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; namespace BS.Shared.DataContracts.Feature.AI { [DataContract] public class AiModelDC : BeWoDataContract, IComparable, IAiModel { public AiModelDC() { } public AiModelDC(AiModelSource modelSource, string name, int value) { ModelSource = modelSource; ModelName = name; Value = value; } [DataMember] public string ModelName { get; set; } [DataMember] public int Value { get; set; } [DataMember] public AiModelSource ModelSource { get; set; } public virtual int CompareTo(AiModelDC other) { if (other == null) return 1; var comp = ModelSource.CompareTo(other.ModelSource); if (comp != 0) return comp; var comp1 = ModelName.CompareTo(other.ModelName); if (comp1 != 0) return comp; var comp2 = Value.CompareTo(other.Value); return comp2; } public override bool Equals(object obj) { return obj is AiModelDC ent && ModelSource == ent.ModelSource && ModelName == ent.ModelName && Value == ent.Value; } public override int GetHashCode() { unchecked { var result = 0; result = (result * 397) ^ ModelSource.GetHashCode(); result = (result * 397) ^ ModelName.GetHashCode(); result = (result * 397) ^ Value.GetHashCode(); return result; } } public override string ToString() { return $"{ModelName} ({ModelSource})"; } } }