diff options
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/PossibleEvent.java')
-rw-r--r-- | src/com/fourisland/fourpuzzle/gamestate/mapview/event/PossibleEvent.java | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/PossibleEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/PossibleEvent.java index c18385d..5ba887b 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/PossibleEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/PossibleEvent.java | |||
@@ -13,7 +13,6 @@ import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraph | |||
13 | import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.EventGraphic; | 13 | import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.EventGraphic; |
14 | import com.fourisland.fourpuzzle.gamestate.mapview.event.movement.MovementType; | 14 | import com.fourisland.fourpuzzle.gamestate.mapview.event.movement.MovementType; |
15 | import com.fourisland.fourpuzzle.gamestate.mapview.event.movement.StayStillMovementType; | 15 | import com.fourisland.fourpuzzle.gamestate.mapview.event.movement.StayStillMovementType; |
16 | import com.fourisland.fourpuzzle.util.Functions; | ||
17 | import java.awt.image.BufferedImage; | 16 | import java.awt.image.BufferedImage; |
18 | 17 | ||
19 | /** | 18 | /** |
@@ -52,7 +51,24 @@ public class PossibleEvent { | |||
52 | return graphic.getImage(); | 51 | return graphic.getImage(); |
53 | } | 52 | } |
54 | 53 | ||
54 | private boolean aSLC = false; | ||
55 | public EventGraphic getGraphic() { | 55 | public EventGraphic getGraphic() { |
56 | if (animation.isAlwaysStepping()) | ||
57 | { | ||
58 | if (aSLC) | ||
59 | { | ||
60 | aSLC = false; | ||
61 | |||
62 | if (animationStep == 0) | ||
63 | { | ||
64 | setAnimationStep(2); | ||
65 | } else { | ||
66 | setAnimationStep(animationStep-1); | ||
67 | } | ||
68 | } else { | ||
69 | aSLC = true; | ||
70 | } | ||
71 | } | ||
56 | return graphic; | 72 | return graphic; |
57 | } | 73 | } |
58 | 74 | ||
@@ -90,7 +106,7 @@ public class PossibleEvent { | |||
90 | 106 | ||
91 | public void setDirection(Direction direction) | 107 | public void setDirection(Direction direction) |
92 | { | 108 | { |
93 | if (Functions.canTurn(this)) | 109 | if (animation.canTurn()) |
94 | { | 110 | { |
95 | this.direction = direction; | 111 | this.direction = direction; |
96 | graphic.setDirection(direction); | 112 | graphic.setDirection(direction); |
@@ -102,8 +118,11 @@ public class PossibleEvent { | |||
102 | } | 118 | } |
103 | 119 | ||
104 | public void setAnimationStep(int animationStep) { | 120 | public void setAnimationStep(int animationStep) { |
105 | this.animationStep = animationStep; | 121 | if (animation.canStep()) |
106 | graphic.setAnimationStep(animationStep); | 122 | { |
123 | this.animationStep = animationStep; | ||
124 | graphic.setAnimationStep(animationStep); | ||
125 | } | ||
107 | } | 126 | } |
108 | 127 | ||
109 | public void addPrecondition(Precondition precondition) | 128 | public void addPrecondition(Precondition precondition) |