2020-11-06 19:23:20 +01:00
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace WotBlitzStatisticsPro.DataAccess.Model.Accounts
|
|
|
|
|
{
|
|
|
|
|
public class AccountInfoHistoryKey : IEquatable<AccountInfoHistoryKey>
|
|
|
|
|
{
|
|
|
|
|
public AccountInfoHistoryKey()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public AccountInfoHistoryKey(long accountId, int lastBattleTime)
|
|
|
|
|
{
|
|
|
|
|
AccountId = accountId;
|
|
|
|
|
LastBattleTime = lastBattleTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public long AccountId { get; set; }
|
|
|
|
|
|
|
|
|
|
public int LastBattleTime { get; set; }
|
|
|
|
|
|
2020-12-27 12:39:25 +01:00
|
|
|
public bool Equals(AccountInfoHistoryKey? other)
|
2020-11-06 19:23:20 +01:00
|
|
|
{
|
|
|
|
|
if (ReferenceEquals(null, other)) return false;
|
|
|
|
|
if (ReferenceEquals(this, other)) return true;
|
|
|
|
|
return AccountId == other.AccountId && LastBattleTime == other.LastBattleTime;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-27 12:39:25 +01:00
|
|
|
public override bool Equals(object? obj)
|
2020-11-06 19:23:20 +01:00
|
|
|
{
|
|
|
|
|
if (ReferenceEquals(null, obj)) return false;
|
|
|
|
|
if (ReferenceEquals(this, obj)) return true;
|
|
|
|
|
if (obj.GetType() != this.GetType()) return false;
|
|
|
|
|
return Equals((AccountInfoHistoryKey) obj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return HashCode.Combine(AccountId, LastBattleTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool operator ==(AccountInfoHistoryKey left, AccountInfoHistoryKey right)
|
|
|
|
|
{
|
|
|
|
|
return Equals(left, right);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool operator !=(AccountInfoHistoryKey left, AccountInfoHistoryKey right)
|
|
|
|
|
{
|
|
|
|
|
return !Equals(left, right);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|