Fixes for equality
This commit is contained in:
@@ -55,5 +55,19 @@ namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
return new ScriptNumberLong(Dictionary.Count);
|
||||
}
|
||||
|
||||
protected bool Equals(DictionaryUserData other)
|
||||
{
|
||||
return Dictionary.Equals(other.Dictionary);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((DictionaryUserData) obj);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -55,5 +55,19 @@ namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
return _typeInfo.UnaryOperator(Value, par1, op);
|
||||
}
|
||||
|
||||
protected bool Equals(GenericUserData other)
|
||||
{
|
||||
return Value.Equals(other.Value);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((GenericUserData) obj);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -71,5 +71,19 @@ namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
return new ScriptNumberLong(List.Count);
|
||||
}
|
||||
|
||||
protected bool Equals(ListUserData other)
|
||||
{
|
||||
return List.Equals(other.List);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((ListUserData) obj);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user