|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoc.robot.SOCBuildingSpeedEstimate
This class calculates approximately how long it would take a player to build something.
Field Summary | |
static int |
CARD
|
static int |
CITY
|
static int |
DEFAULT_ROLL_LIMIT
|
static int |
MAXPLUSONE
|
static int |
MIN
|
protected static boolean |
recalc
|
static int |
ROAD
|
static int |
SETTLEMENT
|
Constructor Summary | |
SOCBuildingSpeedEstimate()
this is a constructor |
|
SOCBuildingSpeedEstimate(SOCPlayerNumbers numbers)
this is a constructor |
Method Summary | |
protected SOCResSetBuildTimePair |
calculateRollsAccurate(SOCResourceSet startingResources,
SOCResourceSet targetResources,
int cutoff,
boolean[] ports)
this figures out how many rolls it would take this player to get the target set of resources given a starting set |
protected SOCResSetBuildTimePair |
calculateRollsFast(SOCResourceSet startingResources,
SOCResourceSet targetResources,
int cutoff,
boolean[] ports)
this figures out how many rolls it would take this player to get the target set of resources given a starting set |
int[] |
getEstimatesFromNothingAccurate(boolean[] ports)
|
int[] |
getEstimatesFromNothingFast(boolean[] ports)
|
int[] |
getEstimatesFromNothingFast(boolean[] ports,
int limit)
|
int[] |
getEstimatesFromNowAccurate(SOCResourceSet resources,
boolean[] ports)
|
int[] |
getEstimatesFromNowFast(SOCResourceSet resources,
boolean[] ports)
|
int[] |
getRollsPerResource()
|
void |
recalculateEstimates(SOCPlayerNumbers numbers)
recalculate both rollsPerResource and resourcesPerRoll |
void |
recalculateEstimates(SOCPlayerNumbers numbers,
int robberHex)
recalculate both rollsPerResource and resourcesPerRoll using the robber information |
void |
recalculateResourcesForRoll(SOCPlayerNumbers numbers)
calculate what resources this player will get on each die roll |
void |
recalculateResourcesForRoll(SOCPlayerNumbers numbers,
int robberHex)
calculate what resources this player will get on each die roll taking the robber into account |
void |
recalculateRollsPerResource(SOCPlayerNumbers numbers)
calculate the estimates |
void |
recalculateRollsPerResource(SOCPlayerNumbers numbers,
int robberHex)
calculate the estimates assuming that the robber is working |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ROAD
public static final int SETTLEMENT
public static final int CITY
public static final int CARD
public static final int MIN
public static final int MAXPLUSONE
public static final int DEFAULT_ROLL_LIMIT
protected static boolean recalc
Constructor Detail |
public SOCBuildingSpeedEstimate(SOCPlayerNumbers numbers)
numbers
- the numbers that the player's pieces are touchingpublic SOCBuildingSpeedEstimate()
Method Detail |
public int[] getEstimatesFromNothingAccurate(boolean[] ports)
ports
- the port flags for the player
public int[] getEstimatesFromNothingFast(boolean[] ports)
ports
- the port flags for the player
public int[] getEstimatesFromNothingFast(boolean[] ports, int limit)
ports
- the port flags for the player
public int[] getEstimatesFromNowAccurate(SOCResourceSet resources, boolean[] ports)
resources
- the player's current resourcesports
- the player's port flags
public int[] getEstimatesFromNowFast(SOCResourceSet resources, boolean[] ports)
resources
- the player's current resourcesports
- the player's port flags
public void recalculateEstimates(SOCPlayerNumbers numbers)
public void recalculateEstimates(SOCPlayerNumbers numbers, int robberHex)
public void recalculateRollsPerResource(SOCPlayerNumbers numbers)
numbers
- the numbers that the player is touchingpublic void recalculateRollsPerResource(SOCPlayerNumbers numbers, int robberHex)
numbers
- the numbers that the player is touchingrobberHex
- where the robber ispublic void recalculateResourcesForRoll(SOCPlayerNumbers numbers)
numbers
- the numbers that the player is touchingpublic void recalculateResourcesForRoll(SOCPlayerNumbers numbers, int robberHex)
numbers
- the numbers that the player is touchingpublic int[] getRollsPerResource()
protected SOCResSetBuildTimePair calculateRollsFast(SOCResourceSet startingResources, SOCResourceSet targetResources, int cutoff, boolean[] ports) throws CutoffExceededException
startingResources
- the starting resourcestargetResources
- the target resourcescutoff
- throw an exception if the total speed is greater than thisports
- a list of port flags
CutoffExceededException
protected SOCResSetBuildTimePair calculateRollsAccurate(SOCResourceSet startingResources, SOCResourceSet targetResources, int cutoff, boolean[] ports) throws CutoffExceededException
startingResources
- the starting resourcestargetResources
- the target resourcescutoff
- throw an exception if the total speed is greater than thisports
- a list of port flags
CutoffExceededException
|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |