Exemple #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);
         }
     }
 }
Exemple #2
0
        public override void DoIt(Student student)
        {
            int time = 0;

            while (student.KnowladgePercentage < 100 && time < MaxDuration)
            {
                CommonTasks.GainKnowlidge(student, 1, Core.KNOWLADGE_PER_ACADEMIC_HOUR);
                time++;
                if (student.Gens.LerningPreferences == LerningPreferencesEnum.EasyGoing)
                {
                    student.Points.Negative += 5;
                }
            }
            switch (time)
            {
            case 0:
                student.Log("I know everything, I don't need to learn");
                break;

            case 1:
                student.Log("I have to learn something");
                break;

            case 2:
                student.Log("I have to learn many things to school");
                break;

            default:
                throw new NotImplementedException();
            }
        }
Exemple #3
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();
            }
        }
Exemple #4
0
 public override void DoIt(Student student)
 {
     student.Log("I'm learning for test");
     while (student.Knowladge < amount && student.PosibilityToLern > Settings.Default.coefGiveUp)
     {
         student.Points.Negative++;
         CommonTasks.GainKnowlidge(student, 1, Core.KNOWLADGE_PER_ACADEMIC_HOUR);
         student.Learned = true;
     }
 }
Exemple #5
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);
            }
        }
Exemple #6
0
        public override void DoIt(Student student)
        {
            double amount;

            switch (student.Gens.SchoolAtention)
            {
            case SchoolAtentionEnum.Active:
                student.Log($"I go to school {duration} h");
                student.Points.Positive += duration;
                amount = Settings.Default.coefSchoolActive;
                student.RemainingTime--;     // Traveling
                break;

            case SchoolAtentionEnum.Pasive:
                student.Log($"I go to school {duration} h, but I don't pay much attention");
                amount = Settings.Default.coefSchoolPasive;
                student.RemainingTime--;     // Traveling
                break;

            case SchoolAtentionEnum.No:
                student.Log("I won't go to school");
                switch (student.Gens.LerningPreferences)
                {
                case LerningPreferencesEnum.Challenging:
                    student.Points.Negative += duration;
                    break;

                case LerningPreferencesEnum.Normal:
                    student.Points.Negative += duration / 2;
                    break;
                }
                amount = 0;
                break;

            default:
                throw new NotImplementedException();
            }
            CommonTasks.GainKnowlidge(student, duration, amount);
            student.BestKnowledge += (int)Core.KNOWLADGE_PER_ACADEMIC_HOUR * duration;
        }
Exemple #7
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();
            }
        }
Exemple #8
0
 public override void DoIt(Student student)
 {
     student.Log("Resting");
     CommonTasks.GainEnergy(student, duration, restCoef);
 }
Exemple #9
0
 public override void DoIt(Student student)
 {
     student.Log("Learning");
     CommonTasks.GainKnowlidge(student, duration, amount);
 }