void SimuleerSpeler(IAthlete testspeler) { for (int i = 0; i < 3; i++) { testspeler.Attack(); testspeler.Stayeren(); } }
public List<IWorkout> GetAllWorkoutsInDateRange(IAthlete athlete, DateTime fromDate, DateTime toDate) { var workouts = soapClient.GetWorkoutsForAccessibleAthlete(athlete.TPData.LoginName, athlete.TPData.LoginPassword, athlete.TPData.PersonID, fromDate, toDate); var internalWorkoutList = new List<IWorkout>(100); internalWorkoutList.AddRange(workouts.Select(TrainingPeaksWorkoutMappings.CovertTPWorkoutToInternal)); return internalWorkoutList; }
public List <IWorkout> GetAllWorkoutsInDateRange(IAthlete athlete, DateTime fromDate, DateTime toDate) { var workouts = soapClient.GetWorkoutsForAccessibleAthlete(athlete.TPData.LoginName, athlete.TPData.LoginPassword, athlete.TPData.PersonID, fromDate, toDate); var internalWorkoutList = new List <IWorkout>(100); internalWorkoutList.AddRange(workouts.Select(TrainingPeaksWorkoutMappings.CovertTPWorkoutToInternal)); return(internalWorkoutList); }
private void button1_Click(object sender, EventArgs e) { SportType selectSport = SportType.Football; IAthlete athlete = GetAthlete(selectSport); athlete.ChangeTeam("Chiefs"); var team = athlete.TeamName; }
public string AthleteName(int seat, bool full) { IAthlete athlete = _athletes.Where(a => a.Seat == seat).FirstOrDefault(); if (athlete != null) { return(full ? athlete.FullName : athlete.Name); } return("???"); }
public void AddAthlete(IAthlete athlete) { var count = this.Athletes.Count; var c = this.Capacity; if (count >= c) { throw new InvalidOperationException("Not enough space in the gym."); } this.athletes.Add(athlete); }
IAthlete FindBesteSpeler(IAthlete speler1, IAthlete speler2) { if (Rand.Next(0, 2) == 0) { return(speler1); } else { return(speler2); } }
public void GetAthleteData(IAthlete theAthlete) { var accessibleAthletes = soapClient.GetAccessibleAthletes(theAthlete.TPData.LoginName, theAthlete.TPData.LoginPassword, TrainingPeaksWorkoutMappings.AccountTypeMapping(theAthlete.TPData.AccountType)); if (accessibleAthletes.Length < 1) throw new Exception("No Athlete Data returned from GetAccessibleAthletes"); if (accessibleAthletes.Length > 1) throw new Exception("More than 1 Athlete in profile for " + theAthlete.TPData.LoginName); var athlete = accessibleAthletes[0]; theAthlete.TPData.AthleteName = athlete.FirstName + " " + athlete.LastName; theAthlete.TPData.PersonID = athlete.PersonId; }
private void ValidateAthlete(IAthlete athlete) { Assert.IsNotNull(athlete.Id, IsNullMessage(athlete_id)); Assert.IsNotNull(athlete.Name, IsNullMessage(athlete_name)); Assert.IsNotNull(athlete.Age, IsNullMessage(athlete_age)); Assert.IsNotNull(athlete.Country, IsNullMessage(athlete_country)); Assert.IsNotNull(athlete.Year, IsNullMessage(athlete_year)); Assert.IsNotNull(athlete.CeremonyDate, IsNullMessage(athlete_CeremonyData)); Assert.IsNotNull(athlete.Sport, IsNullMessage(athlete_Sport)); Assert.IsNotNull(athlete.GoldMedals, IsNullMessage(athlete_goldMedals)); Assert.IsNotNull(athlete.SilverMedals, IsNullMessage(athlete_silverMedals)); Assert.IsNotNull(athlete.BronzeMedals, IsNullMessage(athlete_bronzeMedals)); Assert.IsNotNull(athlete.TotalMedals, IsNullMessage(athlete_totalMedals)); }
public pwx GetExtendedWorkoutData(IAthlete athlete, IWorkout workout) { var stm = new MemoryStream(); var stw = new StreamWriter(stm); var xmlData = workout.ExtendedPwXmlNode = soapClient.GetExtendedWorkoutDataForAccessibleAthlete(athlete.TPData.LoginName, athlete.TPData.LoginPassword, athlete.TPData.PersonID, workout.TPWorkoutID); stw.Write(xmlData.OuterXml); stw.Flush(); stm.Position = 0; var ser = new XmlSerializer(typeof (pwx)); var pwxObj = ser.Deserialize(stm); workout.pwxData = pwxObj; return pwxObj as pwx; }
void SimuleerWedstrijd(IAthlete speler1, IAthlete speler2) { if (Rand.Next(0, 2) == 0) { Output.Log($"{speler1.SpelerNaam} wint."); speler1.Stayeren(); speler1.Attack(); speler1.Details(); } else { Output.Log($"{speler2.SpelerNaam} wint."); speler2.Stayeren(); speler2.Attack(); speler2.Details(); } }
public pwx GetExtendedWorkoutData(IAthlete athlete, IWorkout workout) { var stm = new MemoryStream(); var stw = new StreamWriter(stm); var xmlData = workout.ExtendedPwXmlNode = soapClient.GetExtendedWorkoutDataForAccessibleAthlete(athlete.TPData.LoginName, athlete.TPData.LoginPassword, athlete.TPData.PersonID, workout.TPWorkoutID); stw.Write(xmlData.OuterXml); stw.Flush(); stm.Position = 0; var ser = new XmlSerializer(typeof(pwx)); var pwxObj = ser.Deserialize(stm); workout.pwxData = pwxObj; return(pwxObj as pwx); }
public void GetAthleteData(IAthlete theAthlete) { var accessibleAthletes = soapClient.GetAccessibleAthletes(theAthlete.TPData.LoginName, theAthlete.TPData.LoginPassword, TrainingPeaksWorkoutMappings.AccountTypeMapping(theAthlete.TPData.AccountType)); if (accessibleAthletes.Length < 1) { throw new Exception("No Athlete Data returned from GetAccessibleAthletes"); } if (accessibleAthletes.Length > 1) { throw new Exception("More than 1 Athlete in profile for " + theAthlete.TPData.LoginName); } var athlete = accessibleAthletes[0]; theAthlete.TPData.AthleteName = athlete.FirstName + " " + athlete.LastName; theAthlete.TPData.PersonID = athlete.PersonId; }
public WorkoutSamplesCalculator(WorkoutSamples woSamples, IAthlete athlete) { _workoutSamples = woSamples; _athlete = athlete; }
public void AddAthlete(IAthlete athlete) { _athletes.Add(athlete); }
public List<IWorkout> GetWorkoutsInLast30Days(IAthlete athlete) { return GetAllWorkoutsInDateRange(athlete, DateTime.Now - TimeSpan.FromDays(30), DateTime.Now); }
public IWorkout GetLastWorkoutIn30Days(IAthlete athlete) { var workouts = GetAllWorkoutsInDateRange(athlete, DateTime.Now - TimeSpan.FromDays(30), DateTime.Now); return workouts[0]; }
public IWorkout GetLastWorkoutIn30Days(IAthlete athlete) { var workouts = GetAllWorkoutsInDateRange(athlete, DateTime.Now - TimeSpan.FromDays(30), DateTime.Now); return(workouts[0]); }
public List <IWorkout> GetWorkoutsInLast30Days(IAthlete athlete) { return(GetAllWorkoutsInDateRange(athlete, DateTime.Now - TimeSpan.FromDays(30), DateTime.Now)); }
public void AddAthlete(IAthlete athlete) { throw new NotImplementedException (); }
public void AddAthlete(IAthlete athlete) { throw new NotImplementedException(); }
public bool RemoveAthlete(IAthlete athlete) { return(this.Athletes.Remove(athlete)); }
public void Register(IAthlete <Exercisetype, Resulttype> athlitis) { this.athlitis.Add(athlitis); checkState(); }