diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/AnimationType.java')
-rw-r--r-- | src/com/fourisland/fourpuzzle/gamestate/mapview/event/AnimationType.java | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AnimationType.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AnimationType.java index 7824470..4c3aeb9 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AnimationType.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/AnimationType.java | |||
@@ -46,10 +46,44 @@ public enum AnimationType { | |||
46 | /** | 46 | /** |
47 | * An AnimationType that does not allow the Event to turn or animate. | 47 | * An AnimationType that does not allow the Event to turn or animate. |
48 | */ | 48 | */ |
49 | FixedGraphic(false, false); | 49 | FixedGraphic(false, false), |
50 | /** | ||
51 | * An AnimationType that is identical to CommonWithoutStepping except that | ||
52 | * it causes the Event in question to continually rotate counterclockwise. | ||
53 | */ | ||
54 | TurnLeft(true, true) | ||
55 | { | ||
56 | Interval in = Interval.createTickInterval(2); | ||
57 | |||
58 | @Override | ||
59 | public void tick(PossibleEvent pe) | ||
60 | { | ||
61 | if (in.isElapsed()) | ||
62 | { | ||
63 | pe.setDirection(pe.getDirection().left()); | ||
64 | } | ||
65 | } | ||
66 | }, | ||
67 | /** | ||
68 | * An AnimationType that is identical to CommonWithoutStepping except that | ||
69 | * it causes the Event in question to continually rotate clockwise. | ||
70 | */ | ||
71 | TurnRight(true, true) | ||
72 | { | ||
73 | Interval in = Interval.createTickInterval(2); | ||
74 | |||
75 | @Override | ||
76 | public void tick(PossibleEvent pe) | ||
77 | { | ||
78 | if (in.isElapsed()) | ||
79 | { | ||
80 | pe.setDirection(pe.getDirection().right()); | ||
81 | } | ||
82 | } | ||
83 | }; | ||
50 | 84 | ||
51 | private boolean canTurn; | 85 | private final boolean canTurn; |
52 | private boolean canStep; | 86 | private final boolean canStep; |
53 | private AnimationType(boolean canTurn, boolean canStep) | 87 | private AnimationType(boolean canTurn, boolean canStep) |
54 | { | 88 | { |
55 | this.canTurn = canTurn; | 89 | this.canTurn = canTurn; |