public override int Distance(TypeReference value) { if (value == null) { return(1000); } if (value is NullableTypeReference) { return(parent.Distance(((NullableTypeReference)value).Parent)); } else { if (value.TypeName.Data != "void") { return(1 + parent.Distance(value)); } else { return(0); } } }
public int CompareTo(Parameters parameters, List <TypeReference> types) { for (int i = 0; i < parameters.ParameterList.Count; i++) { TypeReference self = this.parameters[i].TypeReference; TypeReference other = parameters.ParameterList[i].TypeReference; int s = self.Distance(types[i]); int o = other.Distance(types[i]); int c = o.CompareTo(s); if (c != 0) { return(c); } } return(0); }