public void logic(final int currentTurn){
  this.currentTurn=currentTurn;
  Set<TurnListener> set=null;
synchronized (sync) {
    set=register.remove(Integer.valueOf(currentTurn));
  }
  if (logger.isDebugEnabled()) {
    final StringBuilder os=new StringBuilder();
    os.append("register: " + register.size() + "\n");
    int setSize;
    if (set != null) {
      setSize=set.size();
    }
 else {
      setSize=0;
    }
    os.append("set: " + setSize + "\n");
    logger.info(os);
  }
  if (set != null) {
    for (    final TurnListener turnListener : set) {
      try {
        turnListener.onTurnReached(currentTurn);
      }
 catch (      final RuntimeException e) {
        logger.error("Exception in " + turnListener,e);
      }
    }
  }
}

public void logic ( final int currentTurn ) { this . currentTurn = currentTurn ; Set < TurnListener > set = null ; synchronized ( sync ) { set = register . remove ( Integer . valueOf ( currentTurn ) ) ; } if ( logger . isDebugEnabled ( ) ) { final StringBuilder os = new StringBuilder ( ) ; os . append ( "register: " + register . size ( ) + "\n" ) ; int setSize ; if ( set != null ) { setSize = set . size ( ) ; } else { setSize = 0 ; } os . append ( "set: " + setSize + "\n" ) ; logger . info ( os ) ; } if ( set != null ) { for ( final TurnListener turnListener : set ) { try { turnListener . onTurnReached ( currentTurn ) ; } catch ( final RuntimeException e ) { logger . error ( "Exception in " + turnListener , e ) ; } } } }
this method is invoked by stendhalrpruleprocessor . endturn ( ) .
