vooga.engine.core
Class PlayField

java.lang.Object
  extended by com.golden.gamedev.object.PlayField
      extended by vooga.engine.core.PlayField
Direct Known Subclasses:
Level, LevelField

public class PlayField
extends com.golden.gamedev.object.PlayField

Extension of the Golden T Playfield to allow addition of OverlayTracker to the Playfield. Example:

 
 Playfield playfield = new Playfield();
 OverlayTracker track = OverlayCreator.createOverlays(String xmlFileLocation);
 playfield.addOverlayTracker(track);
 


Constructor Summary
PlayField()
           
PlayField(Background background)
           
 
Method Summary
 void addColorBackground(java.awt.Color color)
          Add a color background to the current Collection.
 void addControl(java.lang.String key, Control control)
          Add a control which will be updated everytime the playfield is updated.
 void addEvent(IEventHandler event)
           
 void addEventPool(EventPool eventPool)
           
 void addImageBackground(java.lang.String key)
          Add an image background to the current Collection.
 void addMusic(java.lang.String musicname)
          Here's to adding a music string
 void addOverlayTracker(OverlayTracker overlayTracker)
          Adds OverlayTracker to the playfield.
 void addRule(java.lang.String rulename, Rule rule, SpriteGroup[] obedients)
          This method adds a Rule the playfield.
 Background getBackground(int index)
          Returns the desired background based on the index the user provides.
 Control getControl(java.lang.String key)
          Get control object.
 java.lang.String getMusic(int index)
          Returns the desired music based on the index the user provides.
 OverlayTracker getOverlayTracker()
           
 Rule getRule(java.lang.String ruleName)
           
 void setBackground(int index)
          Makes the background given by the index active in the current playfield.
 void update(long elapsedTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayField

public PlayField(Background background)

PlayField

public PlayField()
Method Detail

update

public void update(long elapsedTime)

addRule

public void addRule(java.lang.String rulename,
                    Rule rule,
                    SpriteGroup[] obedients)
This method adds a Rule the playfield.

Parameters:
rulename -
rule -

addEvent

public void addEvent(IEventHandler event)

addOverlayTracker

public void addOverlayTracker(OverlayTracker overlayTracker)
Adds OverlayTracker to the playfield. And adds all SpriteGroups from the tracker to the playfield.

Parameters:
overlayTracker -

getOverlayTracker

public OverlayTracker getOverlayTracker()

getRule

public Rule getRule(java.lang.String ruleName)

getMusic

public java.lang.String getMusic(int index)
Returns the desired music based on the index the user provides.


addImageBackground

public void addImageBackground(java.lang.String key)
Add an image background to the current Collection. To make a particular background active, use the setBackground method.


addColorBackground

public void addColorBackground(java.awt.Color color)
Add a color background to the current Collection.


getBackground

public Background getBackground(int index)
Returns the desired background based on the index the user provides.


setBackground

public void setBackground(int index)
Makes the background given by the index active in the current playfield.


addControl

public void addControl(java.lang.String key,
                       Control control)
Add a control which will be updated everytime the playfield is updated.

Parameters:
key - key of the Control object
control - Control to be updated with the PlayField

getControl

public Control getControl(java.lang.String key)
Get control object.

Parameters:
key - is key of the Control object

addMusic

public void addMusic(java.lang.String musicname)
Here's to adding a music string

Parameters:
musicname -

addEventPool

public void addEventPool(EventPool eventPool)