public bool Matches(Sue other) { foreach (object key in items.Keys) { if (GetCount(key) != other.GetCount(key) && other.GetCount(key) != "unknown") { return(false); } } return(true); }
public bool Matches2(Sue other) { foreach (object key in items.Keys) { if (other.GetCountValue(key) != -1) { string keyString = (string)key; if (keyString == "cats" || keyString == "trees") { if (GetCountValue(key) >= other.GetCountValue(key)) { return(false); } } else if (keyString == "pomeranians" || keyString == "goldfish") { if (GetCountValue(key) <= other.GetCountValue(key)) { return(false); } } else if (GetCount(key) != other.GetCount(key)) { return(false); } } } return(true); }