InventoryItem IEquatable

This commit is contained in:
Garry Newman 2019-05-10 10:09:52 +01:00
parent eae18553da
commit 075e5460a4

View File

@ -5,7 +5,7 @@
namespace Steamworks
{
public struct InventoryItem
public struct InventoryItem : IEquatable<InventoryItem>
{
internal InventoryItemId _id;
internal InventoryDefId _def;
@ -134,5 +134,8 @@ public struct Amount
public static bool operator ==( InventoryItem a, InventoryItem b ) => a._id == b._id;
public static bool operator !=( InventoryItem a, InventoryItem b ) => a._id != b._id;
public override bool Equals( object p ) => this.Equals( (InventoryItem)p );
public override int GetHashCode() => _id.GetHashCode();
public bool Equals( InventoryItem p ) => p._id == _id;
}
}