import Move; import GameState; import Rules; /** * An artificial intelligence that can make or suggest moves. * The field skill level sets how deep recursion can go, i.e. * how many moves in the future should the computer look? * the color can be anything. * * @ author Paul Bailey, Mark French, Mark Nordheim, Andrew Gorski * @ version 1.0 of March 2000 */ public interface ComputerPlayer { /** * Welcome to our code. Please find the fields skillLevel and color in * the fields department. Moving down you will see our constructor * which takes two parameters, a color and a skill level, both as * ints. The getMove method, our exclusive method, returns a valid * move better than you can think of. */ // +--------+-------------------------------------------------- // | Fields | // +--------+ /**The skill level: */ int skillLevel = 0; /**The color: */ int color = 0; // +--------------+---------------------------------------------- // | Constructors | // +--------------+ /** * parameters: * skill level, how deep should the recursion be? * color, what color is the computer going to be? * purpose: * generates a new computer player that has a given color and a given * skill level as defined in the call. * pre: * -skillLevel is a small positive integer * -color is a small positive integer * post: * a new computer player exists that can use implementations of this class * problems: * pre conditions are not satisfied. * produces: * orange juice! * a new computer player object * * ComputerPlayer(int skillLevel, int color) { } */ // +---------+------------------------------------------------ // | Methods | // +---------+ /** * Purpose: * returns a good move. * produces: * a valid move * pre: * there is a valid move * post: * the move that it returns is valid * problems: * there are no legal moves * parameters: * a GameState class and a Rules class. */ public Move getMove(GameState gs, Rules rules); }