-
Notifications
You must be signed in to change notification settings - Fork 4
/
ItemKey.cs
45 lines (39 loc) · 979 Bytes
/
ItemKey.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_Price_Lister
{
public class ItemKey : IEquatable<ItemKey>
{
public ItemKey(string category, string baseType)
{
BaseType = baseType;
Category = category;
}
public string BaseType { get; }
public string Category { get; }
public override bool Equals(object obj)
{
return Equals(obj as ItemKey);
}
public bool Equals(ItemKey other)
{
return other != null &&
BaseType == other.BaseType &&
Category == other.Category;
}
public override int GetHashCode()
{
int hashCode = -817170655;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(BaseType);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Category);
return hashCode;
}
public override string ToString()
{
return "[" + Category + " " + BaseType + "]";
}
}
}