summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventCall.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventCall.java')
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/gamestate/mapview/event/EventCall.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventCall.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventCall.java index 7214528..c94fc80 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventCall.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventCall.java
@@ -22,20 +22,28 @@ public abstract class EventCall extends SpecialEvent {
22 }; 22 };
23 } 23 }
24 24
25 public abstract void run(); 25 public abstract void run() throws InterruptedException;
26 26
27 private Future isRunning = null; 27 private Future eventThread = null;
28 public void activate(EventCallTime calltime) 28 public void activate(EventCallTime calltime)
29 { 29 {
30 if ((isRunning == null) || (isRunning.isDone())) 30 if ((eventThread == null) || (eventThread.isDone()))
31 { 31 {
32 if (calltime == EventCallTime.ParallelProcess) 32 if (calltime == EventCallTime.ParallelProcess)
33 { 33 {
34 isRunning = EventHandler.runParallel(this); 34 eventThread = EventHandler.runParallel(this);
35 } else { 35 } else {
36 isRunning = EventHandler.runEvent(this); 36 eventThread = EventHandler.runEvent(this);
37 } 37 }
38 } 38 }
39 } 39 }
40 40
41 public void cancel()
42 {
43 if ((eventThread != null) && (!eventThread.isDone()))
44 {
45 eventThread.cancel(true);
46 }
47 }
48
41} 49}