org.vizzini.example.pong
Class Environment

java.lang.Object
  extended by org.vizzini.game.AbstractEnvironment
      extended by org.vizzini.game.arcadegame.AbstractArcadeEnvironment
          extended by org.vizzini.example.pong.Environment
All Implemented Interfaces:
Serializable, Cloneable, IArcadeEnvironment, IEnvironment

public class Environment
extends AbstractArcadeEnvironment

Provides an environment for Pong.

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

Constructor Summary
Environment()
          Construct this object.
 
Method Summary
 Ball getBall()
          Return the ball.
 IAgent getLeftAgent()
          Return the left agent.
 Paddle getLeftPaddle()
          Return the left paddle.
 Paddle getPaddle(IAgent agent)
          Return the paddle which belongs to the given agent.
 IAgent getRightAgent()
          Return the right agent.
 Paddle getRightPaddle()
          Return the right paddle.
protected  void newBall()
          Start a new ball.
 void performAction(IAction action0)
          Perform the given action.
 void reset()
          Reset to the initial state.
 void undoAction(IAction action)
          Undo the given action.
 void update(long deltaTime)
          Update the environment for the given elapsed time.
 
Methods inherited from class org.vizzini.game.arcadegame.AbstractArcadeEnvironment
configure, getDimension, setDimension, setDimension
 
Methods inherited from class org.vizzini.game.AbstractEnvironment
addStateListener, clone, copy, createInitialTokens, equals, get, getAdjudicator, getAgentCollection, getStateManager, getTeamCollection, getTokenCollection, getTokenCollectionClass, getTurnNumber, hashCode, incrementTurnNumber, isFiringStateChanges, open, performActions, removeStateListener, setAdjudicator, setAgentCollection, setFiringStateChanges, setTokenCollectionClass, setTurnNumber
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.vizzini.game.IEnvironment
addStateListener, clone, copy, get, getAdjudicator, getAgentCollection, getTeamCollection, getTokenCollection, getTurnNumber, incrementTurnNumber, isFiringStateChanges, open, performActions, removeStateListener, setAdjudicator, setAgentCollection, setFiringStateChanges, setTurnNumber
 

Constructor Detail

Environment

public Environment()
Construct this object.

Since:
v0.2
Method Detail

getBall

public Ball getBall()
Return the ball.

Since:
v0.1

getLeftAgent

public IAgent getLeftAgent()
Return the left agent.

Since:
v0.1

getLeftPaddle

public Paddle getLeftPaddle()
Return the left paddle.

Since:
v0.1

getPaddle

public Paddle getPaddle(IAgent agent)
Return the paddle which belongs to the given agent.

Since:
v0.1

getRightAgent

public IAgent getRightAgent()
Return the right agent.

Since:
v0.1

getRightPaddle

public Paddle getRightPaddle()
Return the right paddle.

Since:
v0.1

performAction

public void performAction(IAction action0)
Perform the given action.

Parameters:
action0 - Action.
Since:
v0.1

reset

public void reset()
Reset to the initial state.

Specified by:
reset in interface IEnvironment
Overrides:
reset in class AbstractEnvironment
Since:
v0.1

undoAction

public void undoAction(IAction action)
Undo the given action.

Specified by:
undoAction in interface IEnvironment
Overrides:
undoAction in class AbstractArcadeEnvironment
Parameters:
action - Action.
Since:
v0.1

update

public void update(long deltaTime)
Update the environment for the given elapsed time. The base class method has no action.

Specified by:
update in interface IEnvironment
Overrides:
update in class AbstractEnvironment
Parameters:
deltaTime - Delta time per cycle. (ms)
Since:
v0.1

newBall

protected void newBall()
Start a new ball.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02