|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.structure.building.function.Function
org.mars_sim.msp.core.structure.building.function.Farming
public class Farming
The Farming class is a building function for greenhouse farming.
| Field Summary | |
|---|---|
static String |
CROP_EVENT
|
static double |
HARVEST_MULTIPLIER
|
static String |
NAME
|
| Constructor Summary | |
|---|---|
Farming(Building building)
Constructor |
|
| Method Summary | |
|---|---|
void |
addHarvest(double harvest)
Adds harvested food to the farm. |
double |
addWork(double workTime)
Adds work time to the crops current phase. |
void |
destroy()
Prepare object for garbage collection. |
List<Crop> |
getCrops()
Gets the farm's current crops. |
double |
getEstimatedHarvestPerOrbit()
Gets the estimated maximum harvest for one orbit. |
int |
getFarmerNum()
Gets the number of farmers currently working at the farm. |
double |
getFullPowerRequired()
Gets the amount of power required when function is at full power. |
static double |
getFunctionValue(String buildingName,
boolean newBuilding,
Settlement settlement)
Gets the value of the function for a named building. |
double |
getGrowingArea()
Gets the total growing area for all crops. |
double |
getPowerDownPowerRequired()
Gets the amount of power required when function is at power down level. |
boolean |
requiresWork()
Checks if farm currently requires work. |
void |
timePassing(double time)
Time passing for the building. |
| Methods inherited from class org.mars_sim.msp.core.structure.building.function.Function |
|---|
getBuilding, getMalfunctionScopeStrings, getName, removeFromSettlement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CROP_EVENT
public static final String NAME
public static final double HARVEST_MULTIPLIER
| Constructor Detail |
|---|
public Farming(Building building)
building - the building the function is for.
BuildingException - if error in constructing function.| Method Detail |
|---|
public static double getFunctionValue(String buildingName,
boolean newBuilding,
Settlement settlement)
buildingName - the building name.newBuilding - true if adding a new building.settlement - the settlement.
Exception - if error getting function value.public List<Crop> getCrops()
public boolean requiresWork()
public double addWork(double workTime)
workTime - - Work time to be added (millisols)
Exception - if error adding work.public void addHarvest(double harvest)
harvest - harvested food to add (kg.)public int getFarmerNum()
public void timePassing(double time)
timePassing in class Functiontime - amount of time passing (in millisols)
BuildingException - if error occurs.public double getFullPowerRequired()
getFullPowerRequired in class Functionpublic double getPowerDownPowerRequired()
getPowerDownPowerRequired in class Functionpublic double getGrowingArea()
public double getEstimatedHarvestPerOrbit()
Exception - if error determining harvest.public void destroy()
Function
destroy in class Function
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||