Esempio n. 1
0
        static void Main(string[] args)
        {
            Trener       enduranceTraning = new Trener();
            Trener       strengthTraining = new Trener();
            Sportsperson sabina           = new Sportsperson("Sabina");
            Sportsperson pawel            = new Sportsperson("Pawel");

            WriteDiffrentColor("'Sabina' traning");
            enduranceTraning.AddTraning(new Running(sabina));
            enduranceTraning.AddTraning(new Jumping(sabina));
            enduranceTraning.AddTraning(new Gym(sabina));
            enduranceTraning.Train();

            WriteDiffrentColor("'Pawel' traning");
            strengthTraining.AddTraning(new Gym(pawel));
            strengthTraining.AddTraning(new Running(pawel));
            strengthTraining.Train();

            WriteDiffrentColor("Remove the gym from a training plan 'Sabina'");
            enduranceTraning.RemoveTrain(2);
            enduranceTraning.Train();

            WriteDiffrentColor("Remove the gym from a training plan 'Pawel'");
            strengthTraining.RemoveTrain(0);
            strengthTraining.Train();
            Console.ReadKey();
        }
Esempio n. 2
0
 public Gym(Sportsperson _player)
 {
     player = _player;
 }
Esempio n. 3
0
 public Jumping(Sportsperson _player)
 {
     player = _player;
 }
Esempio n. 4
0
 public Running(Sportsperson _player)
 {
     player = _player;
 }