jfreerails.network
Class MoveChainFork

java.lang.Object
  extended by jfreerails.network.MoveChainFork
All Implemented Interfaces:
MoveReceiver

public final class MoveChainFork
extends java.lang.Object
implements MoveReceiver

A central point at which a client may register to receive moves which have been committed.

Author:
Luke, rob

Field Summary
private  long lastTickTime
           
private  java.util.ArrayList<WorldListListener> listListeners
           
private  java.util.ArrayList<WorldMapListener> mapListeners
           
private  java.util.ArrayList<MoveReceiver> moveReceivers
           
private  java.util.ArrayList<MoveReceiver> splitMoveReceivers
           
 
Constructor Summary
MoveChainFork()
           
 
Method Summary
 void addCompleteMoveReceiver(MoveReceiver moveReceiver)
           
 void addListListener(WorldListListener listener)
           
 void addMapListener(WorldMapListener l)
           
 void addSplitMoveReceiver(MoveReceiver moveReceiver)
           
 long getLastTickTime()
           
 void processMove(Move move)
           
 void removeCompleteMoveReceiver(MoveReceiver moveReceiver)
           
 void removeMapListener(WorldMapListener l)
           
private  void sendItemAdded(KEY key, int index, FreerailsPrincipal p)
           
private  void sendItemRemoved(KEY key, int index, FreerailsPrincipal p)
           
private  void sendListUpdated(KEY key, int index, FreerailsPrincipal p)
           
private  void sendMapUpdated(java.awt.Rectangle r)
           
private  void splitMove(Move move)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moveReceivers

private final java.util.ArrayList<MoveReceiver> moveReceivers

splitMoveReceivers

private final java.util.ArrayList<MoveReceiver> splitMoveReceivers

listListeners

private final java.util.ArrayList<WorldListListener> listListeners

mapListeners

private final java.util.ArrayList<WorldMapListener> mapListeners

lastTickTime

private long lastTickTime
Constructor Detail

MoveChainFork

public MoveChainFork()
Method Detail

getLastTickTime

public long getLastTickTime()

addMapListener

public void addMapListener(WorldMapListener l)

removeMapListener

public void removeMapListener(WorldMapListener l)

removeCompleteMoveReceiver

public void removeCompleteMoveReceiver(MoveReceiver moveReceiver)

addCompleteMoveReceiver

public void addCompleteMoveReceiver(MoveReceiver moveReceiver)

addSplitMoveReceiver

public void addSplitMoveReceiver(MoveReceiver moveReceiver)

addListListener

public void addListListener(WorldListListener listener)

processMove

public void processMove(Move move)
Specified by:
processMove in interface MoveReceiver

splitMove

private void splitMove(Move move)

sendMapUpdated

private void sendMapUpdated(java.awt.Rectangle r)

sendItemAdded

private void sendItemAdded(KEY key,
                           int index,
                           FreerailsPrincipal p)

sendItemRemoved

private void sendItemRemoved(KEY key,
                             int index,
                             FreerailsPrincipal p)

sendListUpdated

private void sendListUpdated(KEY key,
                             int index,
                             FreerailsPrincipal p)