Permalink
Browse files

Renaming of the listener in Player interface to the 'on' convention; …

…described Javadoc about the exact meaning.
  • Loading branch information...
lrozenblyum committed Dec 31, 2012
1 parent ef0fac7 commit 10d15690cae57950f34d360305faa150ae4f9de3
@@ -23,7 +23,7 @@ public static void main( String[] args ) {
final PlayerMovedListener onMovePlayerMovedListener = new MoveListener( player );
- player.setOnMoveListener( onMovePlayerMovedListener );
+ player.onMoved( onMovePlayerMovedListener );
//it's main loop
player.run();
@@ -8,8 +8,14 @@
*/
public interface Player extends PlayerMovedListener, DrawOfferedListener, ResignListener {
//may create attach - now it's over-projecting - 1 is OK
- //TODO: rename to new vision
- void setOnMoveListener( PlayerMovedListener playerMovedListenerToSet );
+ /**
+ * Set up listener for the event 'moved'.
+ * It means: current player has executed the move
+ * and informs the interested subscriber (currently only 1)
+ * about this
+ * @param playerMovedListenerToSet
+ */
+ void onMoved( PlayerMovedListener playerMovedListenerToSet );
//TODO: think if it's player's property
void run();
@@ -86,7 +86,7 @@ public void execute( int protocolVersion ) {
//may create attach - now it's over-projecting - 1 is OK
@Override
- public void setOnMoveListener( PlayerMovedListener playerMovedListenerToSet ) {
+ public void onMoved( PlayerMovedListener playerMovedListenerToSet ) {
this.playerMovedListener = playerMovedListenerToSet;
}

0 comments on commit 10d1569

Please sign in to comment.