vooga.engine.level
Interface Rule
- All Known Implementing Classes:
- BlockThroughWall, BorderRule, Decelerate, Floor, GameLost, Gravity, Gravity, LeftWall, OffScreen, RightWall, WallBounce
public interface Rule
This interface allows Rules to be created for games. The developer can add sprite groups
to apply the rule to and check to see if the rule is satisfied for specific sprite groups.
The point of a rule is to call an action when certain criteria are met. The action called
must be defined by the developer.
Method Summary |
void |
enforce(SpriteGroup... groups)
add SpriteGroups that this Rule applies to |
boolean |
isSatisfied(SpriteGroup... groups)
|
enforce
void enforce(SpriteGroup... groups)
- add SpriteGroups that this Rule applies to
- Parameters:
groups
-
isSatisfied
boolean isSatisfied(SpriteGroup... groups)
- Parameters:
SpriteGroup...
- groups
- Returns:
- whether the rule is involved for the given SpriteGroups. This
does not mean that the sprite groups are enforced by the rule, rather
that the rule is activated.