|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.structure.building.function.Crop
public class Crop
The Crop class is a food crop grown on a farm.
Field Summary | |
---|---|
static double |
CARBON_DIOXIDE_NEEDED
|
static java.lang.String |
FINISHED
|
static java.lang.String |
GROWING
|
static java.lang.String |
HARVESTING
|
static java.lang.String |
PLANTING
|
static double |
WASTE_WATER_NEEDED
|
Constructor Summary | |
---|---|
Crop(CropType cropType,
double maxHarvest,
Farming farm,
Settlement settlement,
boolean newCrop)
Constructor |
Method Summary | |
---|---|
double |
addWork(double workTime)
Adds work time to the crops current phase. |
static double |
getAverageCropGrowingTime()
Gets the average growing time for a crop. |
double |
getCondition()
Gets the overall health condition of the crop. |
CropType |
getCropType()
Gets the type of crop. |
double |
getGrowingTimeCompleted()
Gets the amount of growing time completed. |
double |
getMaxHarvest()
Gets the maximum possible food harvest for crop. |
java.lang.String |
getPhase()
Gets the phase of the crop. |
static CropType |
getRandomCropType()
Gets a random crop type. |
boolean |
requiresWork()
Checks if crop needs additional work on current sol. |
void |
timePassing(double time)
Time passing for crop. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double WASTE_WATER_NEEDED
public static final double CARBON_DIOXIDE_NEEDED
public static final java.lang.String PLANTING
public static final java.lang.String GROWING
public static final java.lang.String HARVESTING
public static final java.lang.String FINISHED
Constructor Detail |
---|
public Crop(CropType cropType, double maxHarvest, Farming farm, Settlement settlement, boolean newCrop)
cropType
- the type of crop.maxHarvest
- - Maximum possible food harvest for crop. (kg)farm
- - Farm crop being grown in.settlement
- - the settlement the crop is located at.newCrop
- - true if this crop starts in it's planting phase.Method Detail |
---|
public CropType getCropType()
public java.lang.String getPhase()
public double getMaxHarvest()
public double getGrowingTimeCompleted()
public boolean requiresWork()
public double getCondition()
public double addWork(double workTime) throws java.lang.Exception
workTime
- - Work time to be added (millisols)
java.lang.Exception
- if error adding work.public void timePassing(double time) throws java.lang.Exception
time
- - amount of time passing (millisols)
java.lang.Exception
- if error during time.public static CropType getRandomCropType() throws java.lang.Exception
java.lang.Exception
- if crops could not be found.public static double getAverageCropGrowingTime() throws java.lang.Exception
java.lang.Exception
- if error reading crop config.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |