soc.robot
Class RobberStrategy
java.lang.Object
soc.robot.RobberStrategy
public class RobberStrategy
- extends java.lang.Object
Field Summary |
private static D |
log
debug logging |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static transient D log
- debug logging
RobberStrategy
public RobberStrategy()
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