public FamilyEvent MakeMarriageEvent(int treePersonIndex, int treePersonSpouceIndex, string year) { FamilyEvent retMarriageEvent = null; // Okay, who is the Man, and who is the woman, we need to know // Assume this for now var boyPersonIndex = treePersonIndex; var girlPersonIndex = treePersonSpouceIndex; if (myPeople.allPeople[treePersonIndex].Sex == TreePerson.PersonSex.Female || myPeople.allPeople[treePersonSpouceIndex].Sex == TreePerson.PersonSex.Male) { boyPersonIndex = treePersonSpouceIndex; girlPersonIndex = treePersonIndex; } if (girlPersonIndex != 0) { retMarriageEvent = new FamilyEvent(myPeople, allFamilies, FamilyEvent.FamilyEventType.Marriage, year, girlPersonIndex, boyPersonIndex); } return retMarriageEvent; }
public void AddEvent(FamilyEvent newEvent) { myEvents.Add(newEvent); }
public FamilyEvent makeMatch(int BoyPersonIndex, int currentYear) { int ofAge = 18; FamilyEvent retMarriageEvent = null; int iage = courtHouse.myPeople.allPeople[BoyPersonIndex].age(currentYear); if (iage < ofAge) return retMarriageEvent; int GirlPersonIndex = findAWife(BoyPersonIndex, iage, currentYear); if (GirlPersonIndex != 0) { retMarriageEvent = new FamilyEvent(courtHouse.myPeople, courtHouse.allFamilies, FamilyEvent.FamilyEventType.Marriage, currentYear.ToString(), GirlPersonIndex, BoyPersonIndex); BachelorettePersonIndexList.Remove(GirlPersonIndex); BachelorPersonIndexList.Remove(BoyPersonIndex); } return retMarriageEvent; }