soc.robot
Class DiscardStrategy

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

public class DiscardStrategy
extends java.lang.Object

Strategy when we need to discard. For details see javadoc for discard(int, Stack, Random, SOCPlayer, SOCRobotParameters, SOCRobotDM, SOCRobotNegotiator).


Constructor Summary
DiscardStrategy()
           
 
Method Summary
static SOCResourceSet discard(int numDiscards, java.util.Stack<SOCPossiblePiece> buildingPlan, java.util.Random rand, SOCPlayer ourPlayerData, SOCRobotParameters robotParameters, SOCRobotDM decisionMaker, SOCRobotNegotiator negotiator)
          When we have to discard, try to keep the resources needed for our building plan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscardStrategy

public DiscardStrategy()
Method Detail

discard

public static SOCResourceSet discard(int numDiscards,
                                     java.util.Stack<SOCPossiblePiece> buildingPlan,
                                     java.util.Random rand,
                                     SOCPlayer ourPlayerData,
                                     SOCRobotParameters robotParameters,
                                     SOCRobotDM decisionMaker,
                                     SOCRobotNegotiator negotiator)
When we have to discard, try to keep the resources needed for our building plan. If we don't have a plan, make one by calling SOCRobotDM.planStuff(int). Otherwise, discard at random. Calls SOCRobotNegotiator.setTargetPiece(int, SOCPossiblePiece) to remember the piece we want to build, in case we'll need to trade for its lost resources.