soc.robot
Class RobberStrategy

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

public class RobberStrategy
extends java.lang.Object


Field Summary
private static D log
          debug logging
 
Constructor Summary
RobberStrategy()
           
 
Method Summary
static int chooseRobberVictim(boolean[] choices, SOCGame game, java.util.HashMap<java.lang.Integer,SOCPlayerTracker> playerTrackers)
          choose a robber victim
static int getBestRobberHex(SOCGame game, SOCPlayer ourPlayerData, java.util.HashMap<java.lang.Integer,SOCPlayerTracker> playerTrackers, java.util.Random rand)
          Determine the best hex to move the robber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static transient D log
debug logging

Constructor Detail

RobberStrategy

public RobberStrategy()
Method Detail

getBestRobberHex

public static int getBestRobberHex(SOCGame game,
                                   SOCPlayer ourPlayerData,
                                   java.util.HashMap<java.lang.Integer,SOCPlayerTracker> playerTrackers,
                                   java.util.Random rand)
Determine the best hex to move the robber.


chooseRobberVictim

public static int chooseRobberVictim(boolean[] choices,
                                     SOCGame game,
                                     java.util.HashMap<java.lang.Integer,SOCPlayerTracker> playerTrackers)
choose a robber victim

In some game scenarios (such as SC_PIRI), the robot may have the option to choose to not rob anyone. This strategy will ignore that and always choose a victim to rob.

Parameters:
choices - a boolean array representing which players are possible victims; 1 element per player number (0 to game.maxPlayers - 1).
Returns:
Player number to rob