diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java')
-rw-r--r-- | src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java new file mode 100644 index 0000000..1b10e91 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | * To change this template, choose Tools | Templates | ||
3 | * and open the template in the editor. | ||
4 | */ | ||
5 | |||
6 | package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | ||
7 | |||
8 | import com.fourisland.fourpuzzle.Game; | ||
9 | |||
10 | /** | ||
11 | * | ||
12 | * @author hatkirby | ||
13 | */ | ||
14 | public class HeroLevelPrecondition implements Precondition { | ||
15 | |||
16 | private String heroName; | ||
17 | private int level; | ||
18 | |||
19 | public HeroLevelPrecondition(String heroName, int level) | ||
20 | { | ||
21 | this.heroName = heroName; | ||
22 | this.level = level; | ||
23 | } | ||
24 | |||
25 | public boolean match() throws Exception { | ||
26 | return (Game.getSaveFile().getParty().exists(heroName) && (Game.getSaveFile().getParty().get(heroName).getLevel() == level)); | ||
27 | } | ||
28 | |||
29 | } | ||