|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.golden.gamedev.object.PlayField
vooga.engine.core.PlayField
vooga.engine.level.LevelField
public class LevelField
This class is a PlayField for the level that has all the rules built in, and overrides the update method to handle the updating of all the rules. It also decides whether the level/game should proceed or whether it's failed.
Constructor Summary | |
---|---|
LevelField()
Constructor |
Method Summary | |
---|---|
void |
activateRule(Rule r)
Activate a rule for this specific level |
void |
activateRule(java.lang.String s)
Activate a rule for this specific level |
void |
addEvent(IEventHandler event)
|
void |
addRule(java.lang.String n,
Rule r)
Add a rule to the current level |
void |
addRule(java.lang.String rulename,
Rule rule,
SpriteGroup[] obedients)
add a rule to the current level, together with its associated |
void |
addSpriteGroup(Rule r,
SpriteGroup g)
add a spriteGroup to a rule |
void |
addSwitchConditoin(LevelSwitch ls)
Add a condition that determines which level to switch to and what condition |
void |
checkLevelConditions()
check for the conditions that decide the state of the level |
void |
deactivateRule(Rule r)
Deactivate a rule for this specific level |
void |
deactivateRule(java.lang.String s)
Deactivate a rule for this specific level |
boolean |
gameOver()
Whether the game is lost |
boolean |
gameWon()
Whether the game is won |
LevelField |
getNextLevelField()
return the levelField for the next level and consequenctly updates the rules |
SpriteGroup[] |
getRuleSpriteGroup(Rule r)
Get the SpriteGroups related to a specified rule. |
java.util.ArrayList<SpriteGroup> |
getRuleSpriteGroups()
Get all the SpriteGroups the rules are specifying |
void |
initializeConditions(GameWonConditions gamewon,
GameLostConditions gameLost,
LevelSwitchingConditions levelSwitch)
Initialize the conditions related to the game/level state |
void |
initializeEvents(EventPool pool)
Initialize the events |
void |
initializeRules(java.util.HashMap<java.lang.String,Rule> rm)
Initialize the rules from the specified rule map. |
void |
initializeRules(RulesCollection rc)
Initializes the rules of the current level from the specified RulesCollection class. |
void |
removeEvent(IEventHandler event)
|
void |
removeSwithCondition(LevelSwitch ls)
remove the switch level condition |
boolean |
switchLevel()
|
int |
switchToLevel()
|
void |
update(long elapsedTime)
|
Methods inherited from class vooga.engine.core.PlayField |
---|
addColorBackground, addControl, addEventPool, addImageBackground, addMusic, addOverlayTracker, getBackground, getControl, getMusic, getOverlayTracker, getRule, setBackground |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LevelField()
Method Detail |
---|
public void initializeRules(RulesCollection rc)
rc
- public void initializeEvents(EventPool pool)
pool
- public void addEvent(IEventHandler event)
addEvent
in class PlayField
public void removeEvent(IEventHandler event)
public void addSwitchConditoin(LevelSwitch ls)
ls
- public void removeSwithCondition(LevelSwitch ls)
ls
- public void initializeRules(java.util.HashMap<java.lang.String,Rule> rm)
rm
- public void initializeConditions(GameWonConditions gamewon, GameLostConditions gameLost, LevelSwitchingConditions levelSwitch)
gamewon
- gameLost
- levelProceed
- levelLost
- public void update(long elapsedTime)
update
in class PlayField
public java.util.ArrayList<SpriteGroup> getRuleSpriteGroups()
public SpriteGroup[] getRuleSpriteGroup(Rule r)
r
-
public void checkLevelConditions()
public boolean switchLevel()
public int switchToLevel()
public boolean gameWon()
public boolean gameOver()
public LevelField getNextLevelField()
public void addSpriteGroup(Rule r, SpriteGroup g)
r
- g
- public void activateRule(java.lang.String s)
r
- public void activateRule(Rule r)
r
- public void deactivateRule(java.lang.String s)
r
- public void deactivateRule(Rule r)
r
- public void addRule(java.lang.String rulename, Rule rule, SpriteGroup[] obedients)
addRule
in class PlayField
rulename
- rule
- obedients
- public void addRule(java.lang.String n, Rule r)
n
- r
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |