public void Seed() { for (int i = 0; i < NoOfRegistrants; i++) { Swim newSwim = new Swim(1 + i / SwimMeet.Lanes, 1 + i % SwimMeet.Lanes); newSwim.Registrant = Registrants[i]; newSwim.SwimEvent = this; swims[i] = newSwim; } }
public void Seed() { for (int i = 0; i < Registrants.Count; i++) { Swim newSwim = new Swim(1 + i / SwimMeet.Lanes, 1 + i % SwimMeet.Lanes); newSwim.Registrant = Registrants[i] as Swimmer; newSwim.SwimEvent = this; Swims.Add(newSwim); } }
public void EnterSwimmersTime(Registrant registrant, string swimTime) { Swimmer swimmer = registrant as Swimmer; if (Registrants.Contains(registrant)) { int locator = Registrants.IndexOf(registrant); Swim correspondingSwim = Swims[locator] as Swim; correspondingSwim.SwimTime = swimTime; swimmer.AddAsBestTime(swimMeet.PoolType, Distance, Stroke, TimeSpan.Parse("00:" + swimTime)); return; } throw new Exception("Swimmer has not entered event"); }