public int Execute() { nobles = nobleRepository.GetAll(); foreach (INoble noble in nobles) { oldSkills.Enqueue(noble.Skill); int newSkill = random.Next(0, 100); noble.Skill += newSkill; } return(0); }
private void ListNobles() { string text = ""; Dictionary <int, INoble> .ValueCollection nobles = nobleRepository.GetAll(); foreach (INoble noble in nobles) { text += (noble.ID + ". " + noble.Title + " from institute of " + instituteRepository.Get(noble.InstituteId).Name + ", skill " + noble.Skill + ", works published " + noble.WorksPublished + "\n"); } uiFactory.uidialog.ShowMonolog(text); }
public int Execute() { nobles = nobleRepository.GetAll(); oldNobleRepository = nobleRepository; institutes = instituteRepository.GetAll(); oldInstituteRepository = instituteRepository; foreach (INoble noble in nobles) { IInstitute institute = instituteRepository.Get(noble.InstituteId); while (institute.Influence < noble.Skill) { int oldInfluence = institute.Influence; institute.Influence += institute.Influence / 2; noble.Skill -= oldInfluence; noble.WorksPublished++; } } return(0); }