vooga.gameEngine.controller
Class AIController

java.lang.Object
  extended by vooga.gameEngine.game.GameRelatedObject
      extended by vooga.gameEngine.controller.GameRelatedController
          extended by vooga.gameEngine.controller.AIController
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener
Direct Known Subclasses:
AIDemoController

public class AIController
extends GameRelatedController
implements java.util.EventListener

AIController is an GameRelatedController which manages GameItem's that are affected by AI. As an GameRelatedController, it will store these items in a list. When the AI has some change it would like to make, this class will update all relevant items of the change.

Author:
Scott Brothers, Trevor Terris
See Also:
Serialized Form

Constructor Summary
AIController()
           
 
Method Summary
 void addAIControlledListener(java.util.EventListener listener)
          Adds the item that is controlled by the AI.
 void addItemToListenTo(GameRelatedObject listenTo)
          Adds an item that is listened to by the AI, such as the ball in Pong.
 AbstractPlayer getListener()
          Deprecated. 
 void setDifficulty(int diff)
          sets the AI's difficulty
 void setGame(java.lang.Class<?> C)
          Initiates the AI, taking in the Class that is playing the game and sets up the logic.
 void unset()
          called when the game is over.
 
Methods inherited from class vooga.gameEngine.game.GameRelatedObject
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AIController

public AIController()
Method Detail

setGame

public void setGame(java.lang.Class<?> C)
Initiates the AI, taking in the Class that is playing the game and sets up the logic. If there is no AI for the game given, DummyPlayer is used.

Parameters:
C -

getListener

@Deprecated
public AbstractPlayer getListener()
Deprecated. 

called when the AI needs to be added as a listener to an object (like a ball in Pong). Adding the AI as a listener MUST occur AFTER setGame is called. DEPRECATED, DON'T USE THIS

Returns:

addAIControlledListener

public void addAIControlledListener(java.util.EventListener listener)
Adds the item that is controlled by the AI.

Parameters:
listener -

unset

public void unset()
called when the game is over.


addItemToListenTo

public void addItemToListenTo(GameRelatedObject listenTo)
Adds an item that is listened to by the AI, such as the ball in Pong.

Parameters:
listenTo -

setDifficulty

public void setDifficulty(int diff)
sets the AI's difficulty

Parameters:
diff -