JSettlers v1.0.6 API
Built ${date}

soc.robot
Class SOCPossibleSettlement

java.lang.Object
  extended bysoc.robot.SOCPossiblePiece
      extended bysoc.robot.SOCPossibleSettlement

public class SOCPossibleSettlement
extends SOCPossiblePiece

This is a possible settlement that we can build

Author:
Robert S Thomas

Field Summary
protected  java.util.Vector conflicts
           
protected  java.util.Vector necessaryRoads
           
protected  int numberOfNecessaryRoads
           
protected  java.util.Stack roadPath
           
protected  int[] speedup
           
 
Fields inherited from class soc.robot.SOCPossiblePiece
biggestThreats, CARD, CITY, coord, eta, hasBeenExpanded, MAXPLUSONE, MIN, pieceType, player, ROAD, score, SETTLEMENT, threats, threatUpdatedFlag, updated
 
Constructor Summary
SOCPossibleSettlement(SOCPlayer pl, int co, java.util.Vector nr)
          constructor
SOCPossibleSettlement(SOCPossibleSettlement ps)
          copy constructor Note: This will not copy vectors, only make empty ones
 
Method Summary
 void addConflict(SOCPossibleSettlement s)
          add a conflicting settlement
 void addNecessaryRoad(SOCPossibleRoad rd)
          add a possible road to the list of necessary roads
 java.util.Vector getConflicts()
           
 java.util.Vector getNecessaryRoads()
           
 int getNumberOfNecessaryRoads()
           
 int[] getSpeedup()
           
 int getSpeedupTotal()
           
 void removeConflict(SOCPossibleSettlement s)
          remove a conflicting settlement
 void setNumberOfNecessaryRoads(int num)
          set the minimum number of necessary roads
 void updateSpeedup()
          update the speedup that this settlement gives
 
Methods inherited from class soc.robot.SOCPossiblePiece
addBiggestThreat, addThreat, addToScore, clearBiggestThreats, clearThreats, clearUpdateFlag, getBiggestThreats, getCoordinates, getETA, getPlayer, 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

necessaryRoads

protected java.util.Vector necessaryRoads

conflicts

protected java.util.Vector conflicts

speedup

protected int[] speedup

numberOfNecessaryRoads

protected int numberOfNecessaryRoads

roadPath

protected java.util.Stack roadPath
Constructor Detail

SOCPossibleSettlement

public SOCPossibleSettlement(SOCPlayer pl,
                             int co,
                             java.util.Vector nr)
constructor

Parameters:
pl - the owner
co - coordinates;
nr - necessaryRoads;

SOCPossibleSettlement

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

Parameters:
ps - the possible settlement to copy
Method Detail

getNecessaryRoads

public java.util.Vector getNecessaryRoads()
Returns:
the list of necessary roads

getNumberOfNecessaryRoads

public int getNumberOfNecessaryRoads()
Returns:
the minimum number of necessary roads

setNumberOfNecessaryRoads

public void setNumberOfNecessaryRoads(int num)
set the minimum number of necessary roads

Parameters:
num - the minimum number of necessary roads

updateSpeedup

public void updateSpeedup()
update the speedup that this settlement gives


getConflicts

public java.util.Vector getConflicts()
Returns:
the list of conflicting settlements

addNecessaryRoad

public void addNecessaryRoad(SOCPossibleRoad rd)
add a possible road to the list of necessary roads

Parameters:
rd - the road

addConflict

public void addConflict(SOCPossibleSettlement s)
add a conflicting settlement

Parameters:
s - the settlement

removeConflict

public void removeConflict(SOCPossibleSettlement s)
remove a conflicting settlement

Parameters:
s - the settlement

getSpeedup

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

getSpeedupTotal

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

JSettlers v1.0.6 API
Built ${date}