diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition')
6 files changed, 13 insertions, 30 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java index 0c0af20..b25562b 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java | |||
@@ -8,6 +8,8 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | |||
8 | import com.fourisland.fourpuzzle.Game; | 8 | import com.fourisland.fourpuzzle.Game; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * HeroInPartyPrecondition checks to see if a specific character is in the | ||
12 | * party. | ||
11 | * | 13 | * |
12 | * @author hatkirby | 14 | * @author hatkirby |
13 | */ | 15 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java deleted file mode 100644 index ae8183d..0000000 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
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() | ||
26 | { | ||
27 | return (Game.getSaveFile().getParty().exists(heroName) && (Game.getSaveFile().getParty().get(heroName).getLevel() == level)); | ||
28 | } | ||
29 | |||
30 | } | ||
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java index b275100..46cdcd2 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java | |||
@@ -6,6 +6,12 @@ | |||
6 | package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | 6 | package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * A Precondition is an object that helps <b>LayerEvent</b> to determine which | ||
10 | * of its (possibly many) <b>PossibleEvent</b>s is active. PossibleEvents can | ||
11 | * have Preconditions attached to them and when all Preconditions are fulfilled | ||
12 | * (determined by the <code>true</code> return value from <b>match()</b>) and | ||
13 | * there are not fulfilled PossibleEvents later in the queue, said PossibleEvent | ||
14 | * will be active. | ||
9 | * | 15 | * |
10 | * @author hatkirby | 16 | * @author hatkirby |
11 | */ | 17 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java index 7bccadf..9ea6c16 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java | |||
@@ -8,6 +8,7 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | |||
8 | import com.fourisland.fourpuzzle.Game; | 8 | import com.fourisland.fourpuzzle.Game; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * SwitchPrecondition checks to see if a certain Switch is ON. | ||
11 | * | 12 | * |
12 | * @author hatkirby | 13 | * @author hatkirby |
13 | */ | 14 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java index afedadd..ab8d977 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java | |||
@@ -9,6 +9,8 @@ import com.fourisland.fourpuzzle.util.Comparison; | |||
9 | import com.fourisland.fourpuzzle.Game; | 9 | import com.fourisland.fourpuzzle.Game; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * VariableNumberPrecondition compares a the value of a variable and a number | ||
13 | * together with a specified Comparison. | ||
12 | * | 14 | * |
13 | * @author hatkirby | 15 | * @author hatkirby |
14 | */ | 16 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java index dbdf019..91a31ba 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java | |||
@@ -9,6 +9,8 @@ import com.fourisland.fourpuzzle.util.Comparison; | |||
9 | import com.fourisland.fourpuzzle.Game; | 9 | import com.fourisland.fourpuzzle.Game; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * VariableVariablePrecondition compares two variables together with a specified | ||
13 | * Comparison. | ||
12 | * | 14 | * |
13 | * @author hatkirby | 15 | * @author hatkirby |
14 | */ | 16 | */ |