public class Territory
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static MapConverter |
converter |
| Constructor and Description |
|---|
Territory(java.lang.String name)
Territory constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addGeographicArea(GeographicArea area) |
void |
addLandTile(LandTile tile) |
int |
compareTo(java.lang.String territoryName) |
boolean |
containsMapPoint(MapPoint mapPoint)
Used to link land tiles to a country.
|
MapPoint |
getCapitolLocation()
returns the point representing the shipping location of that country.
(!) note: this method can only be called after the Country's regions have been set. |
long |
getCropBudget()
Get the total budget for all crops
|
long |
getCropBudget(EnumFood food)
Get the budget for the type of food
|
EnumRegion |
getGameRegion() |
java.util.ArrayList<GeographicArea> |
getGeographicBoundary() |
float |
getHumanDevelopmentIndex() |
int |
getLandFarm(int year) |
java.util.Collection<LandTile> |
getLandTiles() |
int |
getLandTotal() |
java.lang.String |
getName() |
double |
getNetCropAvailable(EnumFood crop)
Calculates net crop available using formula from p.
|
double |
getPenaltyValue() |
int |
getPopulation(int year) |
double |
getTotalCropNeed(int year,
EnumFood crop)
Returns how many tons of crop country needs for specified year
|
int |
getUndernourished(int year) |
void |
setAverageConversionFactor(float acf)
This Method calculates the initial category adjustment factors
along with setting the average conversion factor.
|
void |
setCropBudget(EnumFood food,
long budget) |
void |
setCropNeedPerCapita(EnumFood crop,
double tonPerPerson)
Method for setting crop need when already known (e.g., when copying).
|
void |
setCropNeedPerCapita(EnumFood crop,
double tonsConsumed,
double percentUndernourished)
Method for calculating and setting crop need
|
void |
setLandFarm(int year,
int squareKm) |
void |
setLandTotal(int squareKm) |
void |
setMethod(EnumFarmMethod method,
int percentage) |
void |
setPenaltyValue(double penaltyValue) |
void |
setPopulation(int year,
int n) |
void |
setUndernourished(int year,
int people) |
static java.util.ArrayList<Territory> |
territoryLoader()
Constructor takes list of country objects that need data from csv file
|
java.lang.String |
toString() |
void |
updateYield()
Estimates the initial land used per food type, and the yield.
|
public static final MapConverter converter
public Territory(java.lang.String name)
name - country namepublic final java.lang.String getName()
public int getPopulation(int year)
year - year in questionpublic final int getUndernourished(int year)
public final float getHumanDevelopmentIndex()
public final double getPenaltyValue()
public final void setPenaltyValue(double penaltyValue)
public final void setUndernourished(int year,
int people)
public final void setMethod(EnumFarmMethod method, int percentage)
method - cultivation method (Conventional, Organic or GMO)percentage - percentage [0, 100] of land cultivated by the given method.public void setCropNeedPerCapita(EnumFood crop, double tonsConsumed, double percentUndernourished)
crop - EnumFoodtonsConsumed - 2014 production + imports - exportspercentUndernourished - 2014 % of population undernourishedpublic void setCropNeedPerCapita(EnumFood crop, double tonPerPerson)
crop - EnumFoodtonPerPerson - 2014 ton/personpublic double getTotalCropNeed(int year,
EnumFood crop)
year - year in questioncrop - crop in questionpublic final double getNetCropAvailable(EnumFood crop)
crop - crop in questionpublic void setAverageConversionFactor(float acf)
acf - public void setPopulation(int year,
int n)
year - year in questionn - population in that yearpublic EnumRegion getGameRegion()
public void updateYield()
public void setCropBudget(EnumFood food, long budget)
public long getCropBudget(EnumFood food)
food - EnumFoodpublic long getCropBudget()
public int getLandTotal()
public void setLandTotal(int squareKm)
public int getLandFarm(int year)
public void setLandFarm(int year,
int squareKm)
public final java.util.Collection<LandTile> getLandTiles()
public final void addLandTile(LandTile tile)
tile - LandTile to add to countrypublic MapPoint getCapitolLocation()
public boolean containsMapPoint(MapPoint mapPoint)
mapPoint - mapPoint that is being testing for inclusingpublic void addGeographicArea(GeographicArea area)
public java.util.ArrayList<GeographicArea> getGeographicBoundary()
public java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(java.lang.String territoryName)
public static java.util.ArrayList<Territory> territoryLoader()