/// <summary> /// Method to add runner to dictionary. /// </summary> /// <param name="iD"></param> /// <param name="name"></param> /// <param name="surname"></param> /// <param name="age"></param> /// <param name="gender"></param> /// <param name="country"></param> public void AddRunner(int iD, string name, string surname, int age, string gender, string country) { Runner r = new Runner(iD, name, surname, age, gender, country); RunnerList.Add(r.ID, r); }
/// <summary> /// Method to add runner to dictonary. /// </summary> /// <param name="iD"></param> /// <param name="runner"></param> public void AddRunnerToList(int iD, Runner runner) { RunnerList.Add(runner.ID, runner); }
/// <summary> /// adding runner to winning directory, if he already is in it, returns bool /// </summary> public bool IsFinishedRunnerAddedToWinningDirectory(int maximumLaps, int key, Runner runner) { bool ret = false; foreach (var racer in _runnerRepository.GetDictionaryOFRunners()) { if (racer.Value.GetFinishedLapsTimeListCount() >= maximumLaps + 1 && !_winningDirectory.ContainsKey(racer.Key)) { _winningDirectory.Add(racer.Key, racer.Value); ret = true; } } return(ret); }