private void FillData(LoadingScreen l) { string line; int i = 0; while ((line = data.ReadLine()) != null) { Person p = new Person(); ; p.Name = line.Split('=')[1]; p.Birth = new Date(data.ReadLine().Split('=')[1]); p.Death = new Date(data.ReadLine().Split('=')[1]); people.Add(p); i += 3; l.SetProgress(i); } l.Dispose(); }
private bool calculateMeet(Person pe1,Person pe2) { if (pe1.Death.Year < pe2.Birth.Year) return false; else { if (pe1.Death.Year == pe2.Birth.Year) { if (pe1.Death.Month != 0 && pe2.Birth.Month != 0 && pe1.Death.Month < pe2.Birth.Month) return false; else if(pe1.Death.Month == pe2.Birth.Month) if (pe1.Death.Day != 0 && pe2.Birth.Day != 0 && pe1.Death.Day < pe2.Birth.Day) return false; } } return true; }
private void switchPerson(Person pe1, Person pe2) { Person pom = new Person(); if (pe2.Birth.Year > pe1.Birth.Year) { pom = pe1; pe1 = pe2; pe1 = pom; } }