vooga.games.jumper.rules
Class BlockThroughWall
java.lang.Object
vooga.games.jumper.rules.BlockThroughWall
- All Implemented Interfaces:
- Rule
- Direct Known Subclasses:
- LeftWall, RightWall
public class BlockThroughWall
- extends java.lang.Object
- implements Rule
Superclass for RightWall and LeftWall. Contains all the functionality
to send blocks to the other wall if they go through a side wall.
RightWall and LeftWall should be phased out, they only contain two
fields.
Method Summary |
void |
enforce(SpriteGroup... groups)
set type SpriteGroup to be enforced by this rule. |
boolean |
isSatisfied(SpriteGroup... groups)
Check to see if the rule is satisfied. |
void |
reposition(SpriteGroup groups)
Sets the sprites' x value to other wall |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RIGHT_WALL_POSITION
protected int RIGHT_WALL_POSITION
LEFT_WALL_POSITION
protected int LEFT_WALL_POSITION
THIS_WALL_POSITION
protected int THIS_WALL_POSITION
OTHER_WALL_POSITION
protected int OTHER_WALL_POSITION
BlockThroughWall
public BlockThroughWall()
enforce
public void enforce(SpriteGroup... groups)
- set type SpriteGroup to be enforced by this rule.
- Specified by:
enforce
in interface Rule
- Parameters:
any
- number of type SpriteGroup
reposition
public void reposition(SpriteGroup groups)
- Sets the sprites' x value to other wall
- Parameters:
type
- SpriteGroup
isSatisfied
public boolean isSatisfied(SpriteGroup... groups)
- Check to see if the rule is satisfied.
- Specified by:
isSatisfied
in interface Rule
- Parameters:
any
- number of type SpriteGroup
- Returns:
- true if sprite from sprites hit EITHER wall.