player
Class Strategy

java.lang.Object
  |
  +--player.Strategy
Direct Known Subclasses:
DumbHeadNorth, DumbSitAndWait, NoStrategy, PlanA

public abstract class Strategy
extends Object

Abstract Class that implements a player strategy for the ICFP-2002 programming contest.

Version:
$Revision: 1.2 $
Author:
Allen D. Ball

Field Summary
protected  Player player
          The player who owns the strategy.
 
Constructor Summary
protected Strategy()
          Creates a player strategy.
 
Method Summary
 Player getPlayer()
          Method to get the strategy's player.
 void initialize(Player player)
          Method to initialize the strategy.
abstract  Command nextCommand()
          Method to calculate the player's robot next command.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

player

protected Player player
The player who owns the strategy.
Constructor Detail

Strategy

protected Strategy()
Creates a player strategy.
Method Detail

getPlayer

public Player getPlayer()
Method to get the strategy's player.
Returns:
The player this strategy is operating for.

initialize

public void initialize(Player player)
Method to initialize the strategy. Subclasses that override this method should chain a call the superclass's method.
Parameters:
player - The player on whose behalf this strategy will operate.

nextCommand

public abstract Command nextCommand()
Method to calculate the player's robot next command.
Returns:
The next command to send to the player's robot.


Copyright 2002 Allen D. Ball. All rights reserved.