void GetAnotherProspect() { if (!Active) { return; } //if there's any space for prospects left and if there's any empty houses if (Prospects.Count + ProspectsExpecting < maxProspects /* && immigration.Requests.Count > 0 */) { Prole prospect = immigration.GetRandomImmigrant(); LaborType prospectPref = prospect.HighestValue(); if (prospectPref == LaborType.Physical && !HireHighPhy) { return; } if (prospectPref == LaborType.Intellectual && !HireHighInt) { return; } if (prospectPref == LaborType.Emotional && !HireHighEmo) { return; } //get immigrant to this building from outside immigration.SpawnImmigrant(this, prospect); //add prospect to queue ProspectsExpecting++; } }
public float GetWorkerEffectiveness(LaborType lt) { float eff = Retired ? .75f : 1; //retired status makes worker less effective float bonus = GetLaborBonus(lt); eff += bonus * .05f; //each bonus point is equal to +5% productivity return(eff); }
public LaborTypeSpinnerAdapter (LaborType[] items, Context context, int resourceId) : base () { this.items = new List<string> (); foreach (var item in items) { this.items.Add (item.ToUserString ()); } this.context = context; this.resourceId = resourceId; }
public void RollStats(LaborType pref) { //physique = Random.Range(1, 7) + Random.Range(1, 7) + Random.Range(1, 7); //intellect = Random.Range(1, 7) + Random.Range(1, 7) + Random.Range(1, 7); //empathy = Random.Range(1, 7) + Random.Range(1, 7) + Random.Range(1, 7); physique = 10; intellect = 10; empathy = 10; //TAKE PREF INTO ACCOUNT SOMEHOW }
public int GetLaborBonus(LaborType lt) { int score = GetLaborScore(lt); //exceptions to the rule for extremes if (score == 18) { return(3); } if (score == 1) { return(-4); } return((int)((float)(score - 10) / 3)); //each point in bonus represents +5% in productivity }
public int GetLaborScore(LaborType lt) { if (lt == LaborType.Physical) { return(physique); } else if (lt == LaborType.Intellectual) { return(intellect); } else if (lt == LaborType.Emotional) { return(empathy); } return(-1); }
public static string ToUserString(this LaborType type) { switch (type) { case LaborType.Hourly: return(Catalog.GetString("LaborTypeHourly")); case LaborType.OverTime: return(Catalog.GetString("LaborTypeOverTime")); case LaborType.HolidayTime: return(Catalog.GetString("LaborTypeHolidayTime")); default: return(type.ToString()); } }
public Prole(Person person, LaborType pref) { //default status workNode = unemploymentNode; homeNode = unemploymentNode; //if coming from a child, make a new children list if (person is Child) { children = new List <Child>(); } //we want same name, same age, same skin color, same ID yearsOld = person.yearsOld; deltaDays = person.deltaDays; surname = person.surname; name = person.name; skinColor = person.skinColor; ID = person.ID; //roll random stats, taking pref into account RollStats(pref); }
//constructor public Prole(bool randomAge, bool wChildren, LaborType pref) : base(randomAge) { //default status workNode = unemploymentNode; homeNode = unemploymentNode; //random years old (14 + 2d6) if we need yearsOld = randomAge ? comingOfAge - 2 + Random.Range(1, 7) + Random.Range(1, 7) : comingOfAge; children = new List <Child>(); //if prole moves into the city with children if (wChildren) { int numChildren = Random.Range(0, 3); //max of 2 children for (int i = 0; i < numChildren; i++) { CreateChild(); //create children with random age } } //roll random stats, taking pref into account RollStats(pref); }
public void Delete(LaborType entity) { _laborTypeRepository.Delete(entity); }
public void Update(LaborType entity) { _laborTypeRepository.Update(entity); }
public void Add(LaborType entity) { _laborTypeRepository.Add(entity); }
public LaborType SaveLaborType(LaborType laborType) { Session.SaveOrUpdate(laborType); return laborType; }
public LaborType SaveLaborType(LaborType laborType) { Session.SaveOrUpdate(laborType); return(laborType); }