Exemplo n.º 1
0
    private int ActualArrivals()
    {
        int max        = newCitizensNum;
        int freeRooms  = HousingMarket.GetVacantPlacesNum();
        int alarmLimit = max;

        if (Census.GetCitizensNum() > 9 && (ResourceHolder.FoodAlarmLast3Days() || ResourceHolder.WaterAlarmLast3Days()))
        {
            alarmLimit = Mathf.FloorToInt(max * 0.25f);
        }
        return(Min(freeRooms, alarmLimit, max));
    }
Exemplo n.º 2
0
    private void SearchHomeAndWork()
    {
        if (home == null)
        {
            var housing = HousingMarket.GetVacantHouse();
            if (housing != null)
            {
                housing.AddResident(me);
                home = housing;
            }
        }

        if (home != null && firstWork == null)
        {
            var employer = LabourOffice.GetVacantEmployer();
            if (employer != null)
            {
                employer.AddEmployee(me);
                firstWork = employer;
            }
        }
    }
Exemplo n.º 3
0
 void Awake()
 {
     HousingMarket.AddHouse(this);
 }