Example rules to enable/disable challenges (feeds fitness evaluator).

This commit is contained in:
Woody Folsom
2012-03-18 16:41:23 -04:00
parent 862ba2aa31
commit 992f2eef46
4 changed files with 59 additions and 30 deletions

View File

@@ -14,4 +14,20 @@ rule "BeginnerJumper"
then
System.out.println("PlayerProfile indicates Beginner (or better) Jumper. Pipe challenge enabled!"); // consequence
playerProfile.setEnabled(LevelComponent.TYPE.PIPE_JUMP);
end
rule "NoviceRunner"
when
playerProfile : PlayerProfile( runSkill <= 20 ) // condition
then
System.out.println("PlayerProfile indicates NoviceRunner. Disabling Maze challenge."); // consequence
playerProfile.setDisabled(LevelComponent.TYPE.MAZE);
end
rule "BeginnerRunner"
when
playerProfile : PlayerProfile( runSkill > 20 ) // condition
then
System.out.println("PlayerProfile indicates Beginner (or better) Runner. Maze challenge enabled!"); // consequence
playerProfile.setEnabled(LevelComponent.TYPE.MAZE);
end