soc.robot
Class MonopolyStrategy

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

public class MonopolyStrategy
extends java.lang.Object


Field Summary
private  SOCGame game
          Our game
protected  int monopolyChoice
          The resource we want to monopolize, chosen by decidePlayMonopoly(), such as SOCResourceConstants.CLAY or SOCResourceConstants.SHEEP
private  SOCPlayer ourPlayerData
          Our SOCRobotBrain's player
 
Constructor Summary
MonopolyStrategy(SOCGame ga, SOCPlayer pl)
          Create a MonopolyStrategy for a SOCRobotBrain's player.
 
Method Summary
 boolean decidePlayMonopoly()
          Decide whether we should play a monopoly card, and set getMonopolyChoice() if so.
 int getMonopolyChoice()
          Get our monopoly choice; valid only after decidePlayMonopoly() returns true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

game

private final SOCGame game
Our game


ourPlayerData

private final SOCPlayer ourPlayerData
Our SOCRobotBrain's player


monopolyChoice

protected int monopolyChoice
The resource we want to monopolize, chosen by decidePlayMonopoly(), such as SOCResourceConstants.CLAY or SOCResourceConstants.SHEEP

Constructor Detail

MonopolyStrategy

MonopolyStrategy(SOCGame ga,
                 SOCPlayer pl)
Create a MonopolyStrategy for a SOCRobotBrain's player.

Parameters:
ga - Our game
pl - Our player data in ga
Method Detail

getMonopolyChoice

public int getMonopolyChoice()
Get our monopoly choice; valid only after decidePlayMonopoly() returns true.

Returns:
Resource type to monopolize, such as SOCResourceConstants.CLAY or SOCResourceConstants.SHEEP

decidePlayMonopoly

public boolean decidePlayMonopoly()
Decide whether we should play a monopoly card, and set getMonopolyChoice() if so.

Returns:
True if we should play the card