summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-02-03 18:00:24 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-02-03 18:00:24 -0500
commitce6ae1b56e4f6548dc19974474c8ee2d8cece13a (patch)
tree841a308e44cd0441ec86c07189d3a451b286962a /src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java
parentc791c138d4d73b495c8a355ae01bca754e1ce66b (diff)
downloadfourpuzzle-ce6ae1b56e4f6548dc19974474c8ee2d8cece13a.tar.gz
fourpuzzle-ce6ae1b56e4f6548dc19974474c8ee2d8cece13a.tar.bz2
fourpuzzle-ce6ae1b56e4f6548dc19974474c8ee2d8cece13a.zip
Fixed [Gotez06] InterruptedException violation
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java')
-rw-r--r--src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java index 43cf626..faa7a48 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java
@@ -14,8 +14,6 @@ import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.FixedViewpoint;
14import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.MovingViewpoint; 14import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.MovingViewpoint;
15import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.Viewpoint; 15import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.Viewpoint;
16import java.util.concurrent.CountDownLatch; 16import java.util.concurrent.CountDownLatch;
17import java.util.logging.Level;
18import java.util.logging.Logger;
19 17
20/** 18/**
21 * 19 *
@@ -128,8 +126,9 @@ public class SpecialEvent {
128 126
129 /** 127 /**
130 * Waits until all previously called MoveEvent()s have finished 128 * Waits until all previously called MoveEvent()s have finished
129 * @throws InterruptedException
131 */ 130 */
132 public void MoveEventWait() 131 public void MoveEventWait() throws InterruptedException
133 { 132 {
134 MoveEventThread.moveAll(); 133 MoveEventThread.moveAll();
135 } 134 }
@@ -166,14 +165,11 @@ public class SpecialEvent {
166 * Waits for a specified interval 165 * Waits for a specified interval
167 * 166 *
168 * @param wait The time to wait in milliseconds 167 * @param wait The time to wait in milliseconds
168 * @throws InterruptedException
169 */ 169 */
170 public void Wait(int wait) 170 public void Wait(int wait) throws InterruptedException
171 { 171 {
172 try { 172 Thread.sleep(wait);
173 Thread.sleep(wait);
174 } catch (InterruptedException ex) {
175 Logger.getLogger(SpecialEvent.class.getName()).log(Level.SEVERE, null, ex);
176 }
177 } 173 }
178 174
179 /** 175 /**
@@ -193,8 +189,9 @@ public class SpecialEvent {
193 * @param length How long (in milliseconds) it will take to pan 189 * @param length How long (in milliseconds) it will take to pan
194 * @param block If true, the game will wait for the pan to complete 190 * @param block If true, the game will wait for the pan to complete
195 * before executing any more commands 191 * before executing any more commands
192 * @throws InterruptedException
196 */ 193 */
197 public void PanViewpoint(final int x, final int y, int length, final boolean block) 194 public void PanViewpoint(final int x, final int y, int length, final boolean block) throws InterruptedException
198 { 195 {
199 Viewpoint viewpoint = mapView.getViewpoint(); 196 Viewpoint viewpoint = mapView.getViewpoint();
200 final CountDownLatch blocker; 197 final CountDownLatch blocker;
@@ -220,11 +217,7 @@ public class SpecialEvent {
220 217
221 if (block) 218 if (block)
222 { 219 {
223 try { 220 blocker.await();
224 blocker.await();
225 } catch (InterruptedException ex) {
226 Logger.getLogger(SpecialEvent.class.getName()).log(Level.SEVERE, null, ex);
227 }
228 } 221 }
229 } 222 }
230 223