Files
BeWoPlaner/Shared/DataContracts/Feature/AI/AiModelDC.cs

64 lines
1.1 KiB
C#

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BS.Shared.DataContracts.Feature.AI
{
public class AiModelDC : BeWoDataContract, IComparable<AiModelDC>
{
public AiModelDC()
{
}
public AiModelDC(string name, int value)
{
ModelName = name;
Value = value;
}
public string ModelName { get; set; }
public int Value { get; set; }
public int CompareTo(AiModelDC other)
{
if(other == null) return 1;
var comp = ModelName.CompareTo(other.ModelName);
if(comp != 0) return comp;
var comp2 = Value.CompareTo(other.Value);
return comp2;
}
public override bool Equals(object obj)
{
return obj is AiModelDC dc &&
Oid == dc.Oid &&
ModelName == dc.ModelName &&
Value == dc.Value;
}
public override int GetHashCode()
{
unchecked
{
var result = 0;
result = (result * 397) ^ ModelName.GetHashCode();
result = (result * 397) ^ Value.GetHashCode();
return result;
}
}
public override string ToString()
{
return $"{ModelName}";
}
}
}