vooga.games.jumper.events
Class BlockGeneratorEvent

java.lang.Object
  extended by vooga.games.jumper.events.BlockGeneratorEvent
All Implemented Interfaces:
IEventHandler

public class BlockGeneratorEvent
extends java.lang.Object
implements IEventHandler

Event to create the blocks.


Constructor Summary
BlockGeneratorEvent(PlayGameState gamestate)
          Sets the gamestate that this event applies to.
 
Method Summary
 void actionPerformed()
          User defines what to do after event has been triggered.
 boolean isOverlap(int x, int y)
          Prevents blocks from generating over existing blocks.
 boolean isTriggered()
          User defines the condition when the event will be triggered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockGeneratorEvent

public BlockGeneratorEvent(PlayGameState gamestate)
Sets the gamestate that this event applies to.

Parameters:
gamestate -
Method Detail

isTriggered

public boolean isTriggered()
Description copied from interface: IEventHandler
User defines the condition when the event will be triggered

Specified by:
isTriggered in interface IEventHandler
Returns:
true iff the fire condition is satisfied

isOverlap

public boolean isOverlap(int x,
                         int y)
Prevents blocks from generating over existing blocks.

Parameters:
x -
y -
Returns:
true if the proposed block to be generated would overlap with an existing block.

actionPerformed

public void actionPerformed()
Description copied from interface: IEventHandler
User defines what to do after event has been triggered.

Specified by:
actionPerformed in interface IEventHandler