|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.Unit
org.mars_sim.msp.core.structure.Structure
org.mars_sim.msp.core.structure.Settlement
public class Settlement
The Settlement class represents a settlement unit on virtual Mars. It contains information related to the state of the settlement.
| Field Summary | |
|---|---|
static String |
ADD_ASSOCIATED_PERSON_EVENT
|
protected BuildingManager |
buildingManager
|
protected ConstructionManager |
constructionManager
|
protected GoodsManager |
goodsManager
|
protected MalfunctionManager |
malfunctionManager
|
protected PowerGrid |
powerGrid
|
static String |
REMOVE_ASSOCIATED_PERSON_EVENT
|
| Fields inherited from class org.mars_sim.msp.core.Unit |
|---|
CONTAINER_UNIT_EVENT, DESCRIPTION_EVENT, LOCATION_EVENT, MASS_EVENT, NAME_EVENT |
| Constructor Summary | |
|---|---|
protected |
Settlement(String name,
Coordinates location)
Constructor for subclass extension. |
|
Settlement(String name,
String template,
Coordinates location,
int populationNumber)
Constructs a Settlement object at a given location |
| Method Summary | |
|---|---|
void |
addScientificAchievement(double achievementCredit,
Science science)
Add achievement credit to the settlement in a scientific field. |
void |
destroy()
Prepare object for garbage collection. |
Collection<Person> |
getAffectedPeople()
Gets a collection of people affected by this entity. |
int |
getAirlockNum()
Gets the number of airlocks at the settlement. |
double |
getAirPressure()
Gets the air pressure of the life support system. |
double |
getAirPressureModifier()
Gets the air pressure modifier for this settlement. |
Collection<Person> |
getAllAssociatedPeople()
Gets all people associated with this settlement, even if they are out on missions. |
Collection<Vehicle> |
getAllAssociatedVehicles()
Gets all vehicles associated with this settlement, even if they are out on missions. |
Airlock |
getAvailableAirlock()
Gets an available airlock for the settlement. |
int |
getAvailablePopulationCapacity()
Gets the current available population capacity of the settlement |
BuildingManager |
getBuildingManager()
Gets the settlement's building manager. |
ConstructionManager |
getConstructionManager()
Gets the settlement's construction manager. |
boolean |
getConstructionOverride()
Gets the construction override flag. |
int |
getCurrentPopulationNum()
Gets the current population number of the settlement |
GoodsManager |
getGoodsManager()
Gets the settlement's goods manager. |
Person[] |
getInhabitantArray()
Gets an array of current inhabitants of the settlement |
Collection<Person> |
getInhabitants()
Gets a collection of the inhabitants of the settlement. |
int |
getInitialPopulation()
Gets the initial population of the settlement. |
int |
getLifeSupportCapacity()
Gets the number of people the life support can provide for. |
MalfunctionManager |
getMalfunctionManager()
Gets the entity's malfunction manager. |
boolean |
getManufactureOverride()
Gets the manufacture override flag. |
boolean |
getMissionCreationOverride()
Gets the mission creation override flag. |
double |
getOxygenFlowModifier()
Gets the oxygen flow modifier for this settlement. |
int |
getParkedVehicleNum()
Gets the number of vehicles parked at the settlement. |
Collection<Vehicle> |
getParkedVehicles()
Gets a collection of vehicles parked at the settlement. |
int |
getPopulationCapacity()
Gets the population capacity of the settlement |
PowerGrid |
getPowerGrid()
Gets the settlement's power grid. |
boolean |
getResourceProcessOverride()
Gets the resource process override flag. |
double |
getScientificAchievement(Science science)
Gets the settlement's achievement credit for a given scientific field. |
double |
getTemperature()
Gets the temperature of the life support system. |
double |
getTemperatureModifier()
Gets the temperature modifier for this settlement. |
String |
getTemplate()
Gets the settlement template. |
double |
getTotalScientificAchievement()
Gets the settlement's total scientific achievement credit. |
double |
getWaterFlowModifier()
Gets the water flow modifier for this settlement. |
boolean |
lifeSupportCheck()
Returns true if life support is working properly and is not out of oxygen or water. |
double |
provideOxygen(double amountRequested)
Gets oxygen from system. |
double |
provideWater(double amountRequested)
Gets water from system. |
void |
setConstructionOverride(boolean constructionOverride)
Sets the construction override flag. |
void |
setManufactureOverride(boolean manufactureOverride)
Sets the manufacture override flag. |
void |
setMissionCreationOverride(boolean missionCreationOverride)
Sets the mission creation override flag. |
void |
setResourceProcessOverride(boolean resourceProcessOverride)
Sets the resource process override flag. |
void |
timePassing(double time)
Perform time-related processes |
| Methods inherited from class org.mars_sim.msp.core.Unit |
|---|
addUnitListener, compareTo, fireUnitUpdate, fireUnitUpdate, getBaseMass, getContainerUnit, getCoordinates, getDescription, getInventory, getMass, getName, getTopContainerUnit, getUnitManager, hasUnitListener, removeUnitListener, setBaseMass, setContainerUnit, setCoordinates, setDescription, setName, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mars_sim.msp.core.malfunction.Malfunctionable |
|---|
getInventory, getName |
| Field Detail |
|---|
public static final String ADD_ASSOCIATED_PERSON_EVENT
public static final String REMOVE_ASSOCIATED_PERSON_EVENT
protected BuildingManager buildingManager
protected GoodsManager goodsManager
protected ConstructionManager constructionManager
protected PowerGrid powerGrid
protected MalfunctionManager malfunctionManager
| Constructor Detail |
|---|
protected Settlement(String name,
Coordinates location)
name - the settlement's namelocation - the settlement's location
public Settlement(String name,
String template,
Coordinates location,
int populationNumber)
name - the settlement's nametemplate - for the settlementlocation - the settlement's locationpopulationNumber - the settlement's initial population.| Method Detail |
|---|
public int getPopulationCapacity()
public int getCurrentPopulationNum()
public Collection<Person> getInhabitants()
public int getAvailablePopulationCapacity()
public Person[] getInhabitantArray()
public Collection<Vehicle> getParkedVehicles()
public int getParkedVehicleNum()
public boolean lifeSupportCheck()
lifeSupportCheck in interface LifeSupportException - if error checking life support.public int getLifeSupportCapacity()
getLifeSupportCapacity in interface LifeSupportpublic double provideOxygen(double amountRequested)
provideOxygen in interface LifeSupportamountRequested - the amount of oxygen requested from system (kg)
Exception - if error providing oxygen.public double getOxygenFlowModifier()
public double provideWater(double amountRequested)
provideWater in interface LifeSupportamountRequested - the amount of water requested from system (kg)
Exception - if error providing water.public double getWaterFlowModifier()
public double getAirPressure()
getAirPressure in interface LifeSupportpublic double getAirPressureModifier()
public double getTemperature()
getTemperature in interface LifeSupportpublic double getTemperatureModifier()
public void timePassing(double time)
timePassing in class Unittime - the amount of time passing (in millisols)
Exception - if error during time passing.public Collection<Person> getAffectedPeople()
getAffectedPeople in interface Malfunctionablepublic BuildingManager getBuildingManager()
public GoodsManager getGoodsManager()
public Airlock getAvailableAirlock()
public int getAirlockNum()
public PowerGrid getPowerGrid()
public String getTemplate()
public Collection<Person> getAllAssociatedPeople()
public Collection<Vehicle> getAllAssociatedVehicles()
public void setMissionCreationOverride(boolean missionCreationOverride)
missionCreationOverride - override for settlement mission creation.public boolean getMissionCreationOverride()
public void setConstructionOverride(boolean constructionOverride)
constructionOverride - override for settlement construction/salvage
mission creation.public boolean getConstructionOverride()
public void setManufactureOverride(boolean manufactureOverride)
manufactureOverride - override for manufacture.public boolean getManufactureOverride()
public void setResourceProcessOverride(boolean resourceProcessOverride)
resourceProcessOverride - override for resource processes.public boolean getResourceProcessOverride()
public ConstructionManager getConstructionManager()
public double getScientificAchievement(Science science)
science - the scientific field.
public double getTotalScientificAchievement()
public void addScientificAchievement(double achievementCredit,
Science science)
achievementCredit - the achievement credit.science - the scientific field.public MalfunctionManager getMalfunctionManager()
getMalfunctionManager in interface Malfunctionablepublic int getInitialPopulation()
public void destroy()
Unit
destroy in class Unit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||