soc.robot
Class SOCBuildPossibility

java.lang.Object
  extended by soc.robot.SOCBuildPossibility

public class SOCBuildPossibility
extends java.lang.Object

This represents a possible thing to build. It includes what and where to build. A score that represents how many VP this build is worth, and a list of other building possibilities that result from building this thing.


Field Summary
(package private)  int[] buildingSpeedup
           
(package private)  boolean buyDevCard
           
(package private)  java.util.Vector<SOCBuildPossibility> children
           
(package private)  int devCardType
           
(package private)  int eta
           
(package private)  int freeRoads
           
(package private)  SOCBuildPossibility parent
           
(package private)  SOCPlayingPiece piece
           
(package private)  SOCPlayer player
           
(package private)  int priority
           
(package private)  int score
           
 
Constructor Summary
SOCBuildPossibility(int sc, int[] bs, int et, int pr, SOCPlayer pl)
          this is a constructor for buying a dev card
SOCBuildPossibility(int dt, int sc, int[] bs, int et, int pr, SOCPlayer pl)
          this is a constructor for PLAYING a dev card
SOCBuildPossibility(SOCPlayingPiece pi, int sc, int[] bs, int et, int pr, SOCPlayer pl)
          this is a constructor
SOCBuildPossibility(SOCPlayingPiece pi, int sc, int[] bs, int et, int pr, SOCPlayer pl, int fr)
          this is a constructor for when you are using a road building card
 
Method Summary
 void addChild(SOCBuildPossibility poss)
          add a building possibility to the list of children
 int[] getBuildingSpeedup()
           
 java.util.Vector<SOCBuildPossibility> getChildren()
           
 int getDevCardType()
           
 int getETA()
           
 int getFreeRoads()
           
 SOCBuildPossibility getParent()
           
 SOCPlayingPiece getPiece()
           
 SOCPlayer getPlayer()
           
 int getPriority()
           
 int getScore()
           
 boolean isBuyDevCard()
           
 boolean isPlayDevCard()
           
 void setParent(SOCBuildPossibility par)
          set the parent for this node
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

piece

SOCPlayingPiece piece

buyDevCard

boolean buyDevCard

devCardType

int devCardType

freeRoads

int freeRoads

score

int score

buildingSpeedup

int[] buildingSpeedup

eta

int eta

priority

int priority

player

SOCPlayer player

parent

SOCBuildPossibility parent

children

java.util.Vector<SOCBuildPossibility> children
Constructor Detail

SOCBuildPossibility

public SOCBuildPossibility(SOCPlayingPiece pi,
                           int sc,
                           int[] bs,
                           int et,
                           int pr,
                           SOCPlayer pl)
this is a constructor

Parameters:
pi - what and where to build
sc - how many VP this build is worth
bs - how our building speeds are affected
et - how many turns until we can build this
pr - the priority
pl - the player's state after the build

SOCBuildPossibility

public SOCBuildPossibility(SOCPlayingPiece pi,
                           int sc,
                           int[] bs,
                           int et,
                           int pr,
                           SOCPlayer pl,
                           int fr)
this is a constructor for when you are using a road building card

Parameters:
pi - what and where to build
sc - how many VP this build is worth
bs - how our building speeds are affected
et - how many turns until we can build this
pr - the priority
pl - the player's state after the build
fr - how many free roads are left

SOCBuildPossibility

public SOCBuildPossibility(int sc,
                           int[] bs,
                           int et,
                           int pr,
                           SOCPlayer pl)
this is a constructor for buying a dev card

Parameters:
sc - how many VP this build is worth
bs - how our building speeds are affected
et - how many turns until we can build this
pr - the priority
pl - the player's state after the build

SOCBuildPossibility

public SOCBuildPossibility(int dt,
                           int sc,
                           int[] bs,
                           int et,
                           int pr,
                           SOCPlayer pl)
this is a constructor for PLAYING a dev card

Parameters:
dt - which dev card to play
sc - how many VP this build is worth
bs - how our building speeds are affected
et - how many turns until we can build this
pr - the priority
pl - the player's state after the build
Method Detail

getPiece

public SOCPlayingPiece getPiece()
Returns:
the piece

isBuyDevCard

public boolean isBuyDevCard()
Returns:
true if this is a request to buy a dev card

isPlayDevCard

public boolean isPlayDevCard()
Returns:
true if this is a request to play a dev card

getDevCardType

public int getDevCardType()
Returns:
the type of dev card to play or buy

getFreeRoads

public int getFreeRoads()
Returns:
the number of free roads left

getScore

public int getScore()
Returns:
the score

getBuildingSpeedup

public int[] getBuildingSpeedup()
Returns:
the building speed differences

getETA

public int getETA()
Returns:
the number of turns it will take to do this

getPriority

public int getPriority()
Returns:
the priority

getPlayer

public SOCPlayer getPlayer()
Returns:
the player's future state

getChildren

public java.util.Vector<SOCBuildPossibility> getChildren()
Returns:
the building children that this one makes

getParent

public SOCBuildPossibility getParent()
Returns:
the parent of this node

setParent

public void setParent(SOCBuildPossibility par)
set the parent for this node

Parameters:
par - the parent

addChild

public void addChild(SOCBuildPossibility poss)
add a building possibility to the list of children

Parameters:
poss - the building possibility

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable form of this object