jfreerails.controller
Class SimpleMoveExecutor

java.lang.Object
  extended by jfreerails.controller.SimpleMoveExecutor
All Implemented Interfaces:
MoveExecutor

public class SimpleMoveExecutor
extends java.lang.Object
implements MoveExecutor

A MoveExecutor that executes moves on the world object passed to its constructor.

Author:
Luke

Field Summary
private  FreerailsPrincipal p
           
private  World w
           
 
Constructor Summary
SimpleMoveExecutor(World world, int playerID)
           
 
Method Summary
 MoveStatus doMove(Move m)
           
 MoveStatus doPreMove(PreMove pm)
           
 FreerailsPrincipal getPrincipal()
           
 ReadOnlyWorld getWorld()
           
 MoveStatus tryDoMove(Move m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

w

private final World w

p

private final FreerailsPrincipal p
Constructor Detail

SimpleMoveExecutor

public SimpleMoveExecutor(World world,
                          int playerID)
Method Detail

doMove

public MoveStatus doMove(Move m)
Specified by:
doMove in interface MoveExecutor

doPreMove

public MoveStatus doPreMove(PreMove pm)
Specified by:
doPreMove in interface MoveExecutor

tryDoMove

public MoveStatus tryDoMove(Move m)
Specified by:
tryDoMove in interface MoveExecutor

getWorld

public ReadOnlyWorld getWorld()
Specified by:
getWorld in interface MoveExecutor

getPrincipal

public FreerailsPrincipal getPrincipal()
Specified by:
getPrincipal in interface MoveExecutor