public override bool Equals(object other)
{
if (other == null)
{
return false;
}
if (other.Equals(NullValue.Instance()))
{
for (int i = 0; i < building.Length; i++)
{
if (!Get(i).Equals(NullValue.Instance()))
{
return false;
}
}
return true;
}
if (ReferenceEquals(this, other))
{
return true;
}
if (!(other is BaseChain))
{
return false;
}
var chainObject = (BaseChain)other;
if (!alphabet.Equals(chainObject.alphabet))
{
return false;
}
for (int i = 0; (i < chainObject.GetLength()) && (i < building.Length); i++)
{
if (!this[i].Equals(chainObject[i]))
{
return false;
}
}
return true;
}