Hello everyone,
I’m messing around with comparing “strings” from different “grid cells”. I have the grind cells marked by numbers and am messing with comparing the cell number “objects” by name and stumbled upon a “string.Compare” method and was wondering where the outcome of the compared method is placed?
So say it went something like this,
public object objects;
public int CompareTo()
{
if (objects == null) return 1;
Block checkRightSpace = objects as Block;
if (checkRightSpace != null)
return string.Compare(this.name, checkRightSpace.name, StringComparison.CurrentCulture);
else
throw new ArgumentException("Object is not a MatchPieceType");
}
How do I tell if they matched? Something like a debug to see if they did match.