Package model.common

Class HumanManufacture

java.lang.Object
model.common.HumanManufacture

public class HumanManufacture extends Object
  • Field Details

    • startingNrCitizens

      public static int startingNrCitizens
  • Constructor Details

    • HumanManufacture

      public HumanManufacture()
  • Method Details

    • getLivingPlace

      public static Zone getLivingPlace(GameModel gm)
      Getting an available random Residential zone.
      Parameters:
      gm - game model
      Returns:
      Residential zone if found, otherwise null.
    • getClosestWorkingPlace

      public static Zone getClosestWorkingPlace(ArrayList<Zone> availableWorkingZones, Zone livingPlace, GameModel gm)
      Getting the closest working place (zone) from the available ones.
      Parameters:
      availableWorkingZones - in list of work zones which still have empty capacity
      livingPlace - living place of the citizen.
      gm - game model
      Returns:
      closest working place (zone) if found, otherwise null.
    • getEducationLevel

      public static LevelOfEducation getEducationLevel(GameModel gm, Zone livingPlace)
      Returns a random available level of education.
      Parameters:
      gm - game model
      Returns:
      the random education level
    • createYoungCitizen

      public static void createYoungCitizen(GameModel gm)
      Returns a young citizen, assigns it to a random residential zone (if available), and to the closest workPlace (if available)
      Parameters:
      gm - game model
    • createYoungCitizen

      public static void createYoungCitizen(GameModel gm, Zone workPlace, Zone livingPlace)
      Creates a young citizen with workPlace and livingPlace given.
      Parameters:
      gm - game model
      workPlace - working zone for the new citizen
      livingPlace - living zone for the new citizen
    • getWorkingPlace

      public static Zone getWorkingPlace(GameModel gm, Zone livingPlace)
      Gets a working place that is connects to the giving living place.
      Parameters:
      gm - game model
      livingPlace - living place to the work place
      Returns:
      a working place which is connected to the living place.
    • getAvailableSchools

      public static ArrayList<School> getAvailableSchools(GameModel gm, Zone livingPlace)
    • getAvailableUniversities

      public static ArrayList<University> getAvailableUniversities(GameModel gm, Zone livingPlace)