I must be missing something obvious, I cant seem to implement the IEquatable interface in MonoDevelop and Unity…
The error I am getting is:
The type or namespace name IEquatable
1’ could not be found. Are you missing a using directive or an assembly reference?
Here is the start of the class…
using UnityEngine;
using System.Collections.Generic;
public class Item : IEquatable<Item>
{
private string _name;
private int _cost;
private RarityTypes _rarity;
private Texture2D _icon;
public override int GetHashCode()
{
return this.Item.GetHashCode();
}
public override bool Equals(object obj)
{
Item item = obj as Item;
if (item != null)
{
return Equals(item);
}
else
{
return false;
}
}