예제 #1
0
    void GenerateImmigrationCase(CitizenClass _class)
    {
        //for each citizen class:
        //generate citizen.
        //assign home.
        //assign work.

        Citizen newCitizen = GenerateCitizen(_class);

        ResidentialBuilding home = GameManager.buildingsMan.GetResidentialBuildingWithEmptySlot(_class);

        if (home != null) //this shouldn't fail.
        {
            newCitizen.homeAddress = home;
            home.AddResident(newCitizen);
        }
        else
        {
            print("ERROR! Could not assign home to a citizen");
        }

        WorkPlace workPlace = GameManager.buildingsMan.GetEmptyWorkSlot(newCitizen.educationalLevel);

        if (workPlace != null) //contrary to the home case, this is a possibility.
        {
            newCitizen.workAddress = workPlace;
            workPlace.AssignEmployee(newCitizen);
        }

        population.Add(newCitizen);
    }
예제 #2
0
 public void Lookups() //searches for work, health if needed, etc.s
 {
     if (workAddress == null)
     {
         WorkPlace workPlace = GameManager.buildingsMan.GetEmptyWorkSlot(educationalLevel);
         if (workPlace != null) //contrary to the home case, this is a possibility.
         {
             workAddress = workPlace;
             workPlace.AssignEmployee(this);
         }
     }
     if (health < minHealthBeforeSeekingHospitals)
     {
         //TODO handle hopsital lookups and visits here.
     }
 }