|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.server.ai.ColonyPlan
public class ColonyPlan
Objects of this class describes the plan the AI has for a Colony
.
A ColonyPlan
contains WorkLocationPlan
s which defines
the production of each Building
and ColonyTile
.
Colony
Nested Class Summary | |
---|---|
class |
ColonyPlan.Buildable
|
class |
ColonyPlan.Production
|
Field Summary | |
---|---|
static int |
ARTILLERY_PRIORITY
|
static int |
BUILDING_PRIORITY
|
static int |
CHURCH_PRIORITY
|
static int |
CUSTOMS_HOUSE_PRIORITY
|
static int |
DOCKS_PRIORITY
|
static int |
SCHOOL_PRIORITY
|
static int |
TOWN_HALL_PRIORITY
|
static int |
UPGRADE_PRIORITY
|
static int |
WAGON_TRAIN_PRIORITY
|
static int |
WAREHOUSE_PRIORITY
|
Constructor Summary | |
---|---|
ColonyPlan(AIMain aiMain,
Colony colony)
Creates a new ColonyPlan . |
|
ColonyPlan(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new ColonyPlan . |
Method Summary | |
---|---|
void |
adjustProductionAndManufacture()
|
void |
adjustProductionAndManufactureFor(GoodsType rawMat,
GoodsType producedGoods)
|
void |
create()
Creates a plan for this colony. |
AIMain |
getAIMain()
Gets the main AI-object. |
ColonyPlan.Production |
getBestProduction(UnitType unitType)
|
java.util.Iterator<BuildableType> |
getBuildable()
Gets an Iterator for everything to be built in the
Colony . |
GoodsType |
getBuildingReqGoods()
|
Colony |
getColony()
Gets the Colony this ColonyPlan controls. |
int |
getFoodProduction()
Returns the production of food according to this plan. |
Game |
getGame()
Get the Game this object is associated to. |
GoodsType |
getPrimaryRawMaterial()
|
int |
getProductionOf(GoodsType goodsType)
Returns the production of the given type of goods according to this plan. |
ColonyProfile |
getProfile()
Get the Profile value. |
GoodsType |
getSecondaryRawMaterial()
|
java.util.List<WorkLocationPlan> |
getSortedWorkLocationPlans()
Returns the WorkLocationPlan s associated with this
ColonyPlan sorted by production in a decreasing order. |
java.util.List<WorkLocationPlan> |
getWorkLocationPlans()
Returns the WorkLocationPlan s associated with this
ColonyPlan . |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
void |
readFromXMLElement(org.w3c.dom.Element element)
Updates this object from an XML-representation of a ColonyPlan . |
void |
setProfile(ColonyProfile newProfile)
Set the Profile value. |
java.lang.String |
toString()
Creates a String representation of this plan. |
org.w3c.dom.Element |
toXMLElement(org.w3c.dom.Document document)
Creates an XML-representation of this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DOCKS_PRIORITY
public static final int ARTILLERY_PRIORITY
public static final int CHURCH_PRIORITY
public static final int WAGON_TRAIN_PRIORITY
public static final int SCHOOL_PRIORITY
public static final int UPGRADE_PRIORITY
public static final int CUSTOMS_HOUSE_PRIORITY
public static final int TOWN_HALL_PRIORITY
public static final int WAREHOUSE_PRIORITY
public static final int BUILDING_PRIORITY
Constructor Detail |
---|
public ColonyPlan(AIMain aiMain, Colony colony)
ColonyPlan
.
aiMain
- The main AI-object.colony
- The colony to make a ColonyPlan
for.public ColonyPlan(AIMain aiMain, org.w3c.dom.Element element)
ColonyPlan
.
aiMain
- The main AI-object.element
- An Element
containing an XML-representation
of this object.Method Detail |
---|
public java.util.List<WorkLocationPlan> getWorkLocationPlans()
WorkLocationPlan
s associated with this
ColonyPlan
.
WorkLocationPlan
s .public java.util.List<WorkLocationPlan> getSortedWorkLocationPlans()
WorkLocationPlan
s associated with this
ColonyPlan
sorted by production in a decreasing order.
WorkLocationPlan
s .public final ColonyProfile getProfile()
Profile
value.
ColonyProfile
valuepublic final void setProfile(ColonyProfile newProfile)
Profile
value.
newProfile
- The new Profile value.public java.util.Iterator<BuildableType> getBuildable()
Iterator
for everything to be built in the
Colony
.
Buildable
sorted by
priority (highest priority first).public AIMain getAIMain()
public Game getGame()
Game
this object is associated to.
Game
.public void create()
public int getProductionOf(GoodsType goodsType)
goodsType
- The type of goods to check the production for.
ColonyPlan
.public int getFoodProduction()
ColonyPlan
.public ColonyPlan.Production getBestProduction(UnitType unitType)
public void adjustProductionAndManufacture()
public void adjustProductionAndManufactureFor(GoodsType rawMat, GoodsType producedGoods)
public GoodsType getBuildingReqGoods()
public GoodsType getPrimaryRawMaterial()
public GoodsType getSecondaryRawMaterial()
public Colony getColony()
Colony
this ColonyPlan
controls.
Colony
.public org.w3c.dom.Element toXMLElement(org.w3c.dom.Document document)
document
- The Document
in which the
XML-representation should be created.
public void readFromXMLElement(org.w3c.dom.Element element)
ColonyPlan
.
element
- The XML-representation.public static java.lang.String getXMLElementTagName()
public java.lang.String toString()
String
representation of this plan.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |