cz.cvut.agents.rph.reversi.main
Class HeadlessReversiCreator

java.lang.Object
  extended by cz.cvut.agents.rph.reversi.main.HeadlessReversiCreator
Direct Known Subclasses:
ReversiCreator

public class HeadlessReversiCreator
extends java.lang.Object

Creator of the Reversi game without the GUI ReversiView. No restarts. Author: Ondrej Vanek Date: 10/3/12 Time: 10:09 AM


Field Summary
protected  ReversiController controller
          Controller of the game.
protected  ReversiModel model
          Model of the game.
protected static int PLAYGROUND_HEIGHT
          Height of the playground.
protected static int PLAYGROUND_WIDTH
          Width of the playground.
protected  int timeoutInMilis
          Timeout for one move in miliseconds.
 
Constructor Summary
HeadlessReversiCreator()
           
 
Method Summary
protected  ReversiController createGame(int width, int height, ReversiPlayer player1, ReversiPlayer player2)
           
static void main(java.lang.String[] args)
          Creates a Reversi game.
private  ReversiGameResult playGame()
          Plays the game with autorun enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PLAYGROUND_WIDTH

protected static final int PLAYGROUND_WIDTH
Width of the playground.

See Also:
Constant Field Values

PLAYGROUND_HEIGHT

protected static final int PLAYGROUND_HEIGHT
Height of the playground.

See Also:
Constant Field Values

model

protected ReversiModel model
Model of the game.


controller

protected ReversiController controller
Controller of the game.


timeoutInMilis

protected int timeoutInMilis
Timeout for one move in miliseconds.

Constructor Detail

HeadlessReversiCreator

public HeadlessReversiCreator()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Creates a Reversi game. Players can be specified in the arguments

Parameters:
args - full names of the player classes (e.g. cz.cvut.agents.rph.reversi.players.WrongMovePlayer)
Throws:
java.lang.Exception

createGame

protected ReversiController createGame(int width,
                                       int height,
                                       ReversiPlayer player1,
                                       ReversiPlayer player2)
                                throws java.lang.Exception
Throws:
java.lang.Exception

playGame

private ReversiGameResult playGame()
                            throws java.lang.Exception
Plays the game with autorun enabled.

Throws:
java.lang.Exception