Esempio n. 1
0
 public override void DoIt(Student student)
 {
     if (student.Gens.FoodHabits == FoodHabitsEnum.FromHome)
     { // I should go home because of food from mum
         student.ToHomeOffset = (student.ToHomeOffset + Settings.Default.homeFood) / 2;
     }
     else
     {
         student.ToHomeOffset = (student.ToHomeOffset + (100 - Settings.Default.homeFood)) / 2;
     }
     if (Core.rn.Next(100) < student.ToHomeOffset)
     {
         student.ToHomeOffset    /= 3;
         student.Points.Positive += 5;
         if (student.Gens.LearningHabits == LearningHabitsEnum.Continuous)
         {
             student.Log("I travel to home and learn to school");
             CommonTasks.GainKnowlidge(student, Settings.Default.timeToHome * 2, Core.KNOWLADGE_PER_ACADEMIC_HOUR);
         }
         else
         {
             student.Log("I go home");
             CommonTasks.GainEnergy(student, Settings.Default.timeToHome * 2);
         }
     }
 }
Esempio n. 2
0
        public override void DoIt(Student student)
        {
            switch (freetimePreferencesEnum)
            {
            case FreetimePreferencesEnum.Friends:
                student.Log("I'm going out with friends");
                student.Points.Positive += 8;
                CommonTasks.GainEnergy(student, FriendsTime);
                break;

            case FreetimePreferencesEnum.Sport:
                student.Log("I'm going running");
                student.Points.Positive += 4;
                CommonTasks.GainEnergy(student, SportTime);
                break;

            case FreetimePreferencesEnum.Nothing:
                student.Points.Positive += 2;
                student.Log("I will do nothing");
                CommonTasks.GainEnergy(student, NothingTime);
                break;

            case FreetimePreferencesEnum.Reading:
                student.Points.Positive += 2;
                student.Log("I read a book");
                CommonTasks.GainEnergy(student, ReadingTime, (Settings.Default.coefRest + 1) / 2);
                Settings.Default.Reload();
                break;

            default:
                throw new NotImplementedException();
            }
        }
Esempio n. 3
0
        public override void DoIt(Student student)
        {
            int time = CountSleepDuration(student);

            if (time >= 4)
            {
                student.Points.Positive += 5;
                student.Log("I will have long sleeping (" + time * 1.5 + " h)");
                CommonTasks.GainEnergy(student, 8);
            }
            else if (time > 2)
            {
                student.Log("I go sleeping " + time * 1.5 + " h");
                CommonTasks.GainEnergy(student, duration);
            }
            else
            {
                Debug.Assert(false);
            }
        }
Esempio n. 4
0
        public override void DoIt(Student student)
        {
            switch (student.Gens.FoodHabits)
            {
            case FoodHabitsEnum.Cooking:
                student.Log("I cook food");
                student.Points.Positive += 5;
                CommonTasks.GainEnergy(student, Core.COOK_TIME);
                break;

            case FoodHabitsEnum.Restaurant:
                student.Log("I go to restaurant");
                CommonTasks.GainEnergy(student, EasyCookTime);
                break;

            case FoodHabitsEnum.FromHome:
                student.Log("I have food from mum");
                CommonTasks.GainEnergy(student, EasyCookTime);
                break;

            default:
                throw new NotImplementedException();
            }
        }
Esempio n. 5
0
 public override void DoIt(Student student)
 {
     student.Log("Resting");
     CommonTasks.GainEnergy(student, duration, restCoef);
 }