soc.robot
Class SOCPossibleCity

java.lang.Object
  extended by soc.robot.SOCPossiblePiece
      extended by soc.robot.SOCPossibleCity

public class SOCPossibleCity
extends SOCPossiblePiece

This is a possible city that we can build

Author:
Robert S Thomas

Field Summary
protected  int[] speedup
          Speedup per building type.
 
Fields inherited from class soc.robot.SOCPossiblePiece
biggestThreats, CARD, CITY, coord, eta, hasBeenExpanded, MAXPLUSONE, MIN, PICK_SPECIAL, pieceType, player, ROAD, score, SETTLEMENT, SHIP, threats, threatUpdatedFlag, updated
 
Constructor Summary
SOCPossibleCity(SOCPlayer pl, int co)
          constructor
SOCPossibleCity(SOCPossibleCity pc)
          copy constructor Note: This will not copy vectors, only make empty ones
 
Method Summary
 int[] getSpeedup()
           
 int getSpeedupTotal()
           
 void updateSpeedup()
          calculate the speedup that this city gives.
 
Methods inherited from class soc.robot.SOCPossiblePiece
addBiggestThreat, addThreat, addToScore, clearBiggestThreats, clearThreats, clearUpdateFlag, getBiggestThreats, getCoordinates, getETA, getPlayer, getResourcesToBuild, getScore, getThreats, getType, hasBeenExpanded, isETAUpdated, isThreatUpdated, resetExpandedFlag, resetScore, setETA, setExpandedFlag, subtractFromScore, threatUpdated, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

speedup

protected int[] speedup
Speedup per building type. Indexed from SOCBuildingSpeedEstimate.MIN to SOCBuildingSpeedEstimate.MAXPLUSONE.

Constructor Detail

SOCPossibleCity

public SOCPossibleCity(SOCPlayer pl,
                       int co)
constructor

Parameters:
pl - the owner
co - coordinates;

SOCPossibleCity

public SOCPossibleCity(SOCPossibleCity pc)
copy constructor Note: This will not copy vectors, only make empty ones

Parameters:
pc - the possible city to copy
Method Detail

updateSpeedup

public void updateSpeedup()
calculate the speedup that this city gives. Call when any player's new city or settlement is added to the board.

See Also:
getSpeedup()

getSpeedup

public int[] getSpeedup()
Returns:
the speedup for this city

getSpeedupTotal

public int getSpeedupTotal()
Returns:
the sum of all of the speedup numbers
See Also:
updateSpeedup()