void SimuleerSpeler(IAthlete testspeler)
 {
     for (int i = 0; i < 3; i++)
     {
         testspeler.Attack();
         testspeler.Stayeren();
     }
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            SportType selectSport = SportType.Football;

            IAthlete athlete = GetAthlete(selectSport);

            athlete.ChangeTeam("Chiefs");

            var team = athlete.TeamName;
        }
Esempio n. 5
0
        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("???");
        }
Esempio n. 6
0
        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);
     }
 }
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
 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));
 }
Esempio n. 10
0
 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();
     }
 }
Esempio n. 12
0
        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);
        }
Esempio n. 13
0
        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;
 }
Esempio n. 15
0
 public void AddAthlete(IAthlete athlete)
 {
     _athletes.Add(athlete);
 }
Esempio n. 16
0
 public List<IWorkout> GetWorkoutsInLast30Days(IAthlete athlete)
 {
     return GetAllWorkoutsInDateRange(athlete, DateTime.Now - TimeSpan.FromDays(30), DateTime.Now);
 }
Esempio n. 17
0
 public IWorkout GetLastWorkoutIn30Days(IAthlete athlete)
 {
     var workouts = GetAllWorkoutsInDateRange(athlete, DateTime.Now - TimeSpan.FromDays(30), DateTime.Now);
     return workouts[0];
 }
Esempio n. 18
0
        public IWorkout GetLastWorkoutIn30Days(IAthlete athlete)
        {
            var workouts = GetAllWorkoutsInDateRange(athlete, DateTime.Now - TimeSpan.FromDays(30), DateTime.Now);

            return(workouts[0]);
        }
Esempio n. 19
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 WorkoutSamplesCalculator(WorkoutSamples woSamples, IAthlete athlete)
 {
     _workoutSamples = woSamples;
     _athlete        = athlete;
 }
 public void AddAthlete(IAthlete athlete)
 {
     throw new NotImplementedException();
 }
Esempio n. 23
0
 public bool RemoveAthlete(IAthlete athlete)
 {
     return(this.Athletes.Remove(athlete));
 }
Esempio n. 24
0
 public void AddAthlete(IAthlete athlete)
 {
     _athletes.Add(athlete);
 }
Esempio n. 25
0
 public void Register(IAthlete <Exercisetype, Resulttype> athlitis)
 {
     this.athlitis.Add(athlitis);
     checkState();
 }