public override bool Equals(System.Object obj)
{
// If parameter is null return false.
if (obj == null)
{
return false;
}
// If parameter cannot be cast to Point return false.
AgentType p = obj as AgentType;
if ((System.Object)p == null)
{
return false;
}
// Return true if the fields match:
return this.position.Equals(p.position) &&
this.refPosition.Equals(p.refPosition);
}