void GenerateUnmatchedList() { Unmatched = new List <Match>(); foreach (PledgeObject pledge in Pledges) { foreach (string BigName in pledge.BigChoices) { BrotherObject BigChoice = Brothers.Find(big => big.FullName == BigName); if (BigChoice != null) { Unmatched.Add(new Match(pledge, BigChoice)); } } } foreach (BrotherObject brother in Brothers) { foreach (string LittleName in brother.LittleChoices) { PledgeObject LittleChoice = Pledges.Find(little => little.FullName == LittleName); if (LittleChoice != null) { Match m = new Match(brother, LittleChoice); if (Unmatched.Find(mat => mat.Brother.FullName == brother.FullName && mat.Pledge.FullName == LittleChoice.FullName) == null) { Unmatched.Add(m); } } } } }
public static Match Unmatched(PledgeObject p) { Match ToReturn = new Match(); ToReturn.Pledge = p; ToReturn.Brother = BrotherObject.Unmatched(); ToReturn.matchRating = 10; return(ToReturn); }
public Match(BrotherObject b, PledgeObject p) { Pledge = p; Brother = b; if (Pledge.BigChoices.Contains(Brother.FullName)) { //if brother put this little on their list, matchrating is the sum of the index of both names matchRating = Brother.LittleChoices.IndexOf(Pledge.FullName) + Pledge.BigChoices.IndexOf(Brother.FullName); } else { //if brother did not put little on their list, matchrating is the index of matchRating = Brother.LittleChoices.IndexOf(Pledge.FullName) + 5; } }
public Match(PledgeObject p, BrotherObject b) { Pledge = p; Brother = b; //we assume that brother b is in pledge p's biglist if (Brother.LittleChoices.Contains(Pledge.FullName)) { //if brother put this little on their list, matchrating is the sum of the index of both names matchRating = Pledge.BigChoices.IndexOf(Brother.FullName) + Brother.LittleChoices.IndexOf(Pledge.FullName); } else { //if brother did not put little on their list, matchrating is the index of matchRating = Pledge.BigChoices.IndexOf(Brother.FullName) + 5; } }
public Match(bool isBest) { this.Brother = null; this.Pledge = null; this.matchRating = (isBest)? 10 : 0; }