org.vizzini.example.pong.ui
Class MouseHumanAgent

java.lang.Object
  extended by org.vizzini.game.AbstractAgent
      extended by org.vizzini.game.AbstractHumanAgent
          extended by org.vizzini.example.pong.ui.MouseHumanAgent
All Implemented Interfaces:
MouseMotionListener, Serializable, EventListener, IActionReceivedProducer, IStateListener, IAgent, IHumanAgent, IListener

public class MouseHumanAgent
extends AbstractHumanAgent
implements MouseMotionListener, IActionReceivedProducer, IStateListener

Since:
v0.1
Version:
v0.2
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.vizzini.game.IAgent
NAME_PROPERTY, TEAM_PROPERTY
 
Constructor Summary
MouseHumanAgent()
           
 
Method Summary
 void addActionReceivedListener(IActionReceivedListener listener)
          Add the given listener.
 IAction getAction(IEnvironment environment, IAdjudicator adjudicator)
          Return the action determined through consideration of the given environment using the given adjudicator.
 void mouseDragged(MouseEvent event)
          Callback for the mouse dragged action.
 void mouseEntered(MouseEvent event)
          Callback for the mouse entered action.
 void mouseExited(MouseEvent event)
          Callback for the mouse exited action.
 void mouseMoved(MouseEvent event)
          Callback for the mouse moved action.
 void removeActionReceivedListener(IActionReceivedListener listener)
          Remove the given listener.
 void stateChange(StateEvent event)
          Respond to state change events.
 
Methods inherited from class org.vizzini.game.AbstractHumanAgent
beep
 
Methods inherited from class org.vizzini.game.AbstractAgent
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, configure, equals, getConcedeManager, getIndex, getName, getProperties, getPropertyChangeManager, getScore, getScoreManager, getTeam, getTokenCollection, getTokenCollectionClass, hashCode, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam, setTokenCollectionClass, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.IAgent
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, configure, getName, getScore, getTeam, getTokenCollection, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam
 

Constructor Detail

MouseHumanAgent

public MouseHumanAgent()
Method Detail

addActionReceivedListener

public void addActionReceivedListener(IActionReceivedListener listener)
Add the given listener.

Specified by:
addActionReceivedListener in interface IActionReceivedProducer
Since:
v0.1

getAction

public IAction getAction(IEnvironment environment,
                         IAdjudicator adjudicator)
Return the action determined through consideration of the given environment using the given adjudicator.

Specified by:
getAction in interface IAgent
Parameters:
environment - The current environment.
adjudicator - Adjudicator for determining legal actions.
Since:
v0.1

mouseDragged

public void mouseDragged(MouseEvent event)
Callback for the mouse dragged action.

Specified by:
mouseDragged in interface MouseMotionListener
Since:
v0.1

mouseEntered

public void mouseEntered(MouseEvent event)
Callback for the mouse entered action.

Since:
v0.1

mouseExited

public void mouseExited(MouseEvent event)
Callback for the mouse exited action.

Since:
v0.1

mouseMoved

public void mouseMoved(MouseEvent event)
Callback for the mouse moved action.

Specified by:
mouseMoved in interface MouseMotionListener
Since:
v0.1

removeActionReceivedListener

public void removeActionReceivedListener(IActionReceivedListener listener)
Remove the given listener.

Specified by:
removeActionReceivedListener in interface IActionReceivedProducer
Since:
v0.1

stateChange

public void stateChange(StateEvent event)
Respond to state change events. This method creates a action to move the paddle toward the ball.

Specified by:
stateChange in interface IStateListener
Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02