diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-01-17 10:36:37 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-01-17 10:36:37 -0500 |
commit | 69b495c392bffe96dab97306a42466edd4b2474e (patch) | |
tree | 2adccc01f4027bcb76bbefee03bb6a9622ce3e00 /src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java | |
parent | 4c768483aecd687529b9abb48ed42950fabc886f (diff) | |
download | fourpuzzle-69b495c392bffe96dab97306a42466edd4b2474e.tar.gz fourpuzzle-69b495c392bffe96dab97306a42466edd4b2474e.tar.bz2 fourpuzzle-69b495c392bffe96dab97306a42466edd4b2474e.zip |
Imported sources
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java')
-rw-r--r-- | src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java new file mode 100644 index 0000000..26f89c7 --- /dev/null +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/SpecialEvent.java | |||
@@ -0,0 +1,173 @@ | |||
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; | ||
7 | |||
8 | import com.fourisland.fourpuzzle.*; | ||
9 | import com.fourisland.fourpuzzle.gamestate.mapview.event.specialmove.MoveEvent; | ||
10 | import com.fourisland.fourpuzzle.gamestate.mapview.event.specialmove.MoveEventThread; | ||
11 | import java.util.concurrent.BrokenBarrierException; | ||
12 | import java.util.concurrent.CyclicBarrier; | ||
13 | import java.util.logging.Level; | ||
14 | import java.util.logging.Logger; | ||
15 | |||
16 | /** | ||
17 | * | ||
18 | * @author hatkirby | ||
19 | */ | ||
20 | public class SpecialEvent { | ||
21 | |||
22 | /** | ||
23 | * Display a message on the screen. | ||
24 | * | ||
25 | * Usually used for dialogue. If SetFace() is | ||
26 | * | ||
27 | * used prior to this, the face set is displayed | ||
28 | * on the left side. | ||
29 | * | ||
30 | * Display of the message area can be modified using | ||
31 | * MessageDisplaySettings(). | ||
32 | * | ||
33 | * This function also automatically splits your | ||
34 | * message up into blocks that will fit on | ||
35 | * the screen (breaks at spaces). If there are too | ||
36 | * many words, they will be held and displayed in | ||
37 | * the message area after the prior message has | ||
38 | * been read. | ||
39 | * | ||
40 | * @param message The message to display | ||
41 | */ | ||
42 | public void DisplayMessage(String message) | ||
43 | { | ||
44 | throw new UnsupportedOperationException("Not yet implemented"); | ||
45 | } | ||
46 | |||
47 | /** | ||
48 | * Sets the face used when displaying a message | ||
49 | * | ||
50 | * See DisplayMessage() for more info | ||
51 | * | ||
52 | * @param faceSet The name of the FaceSet to use | ||
53 | * @param face The number of the face in the FaceSet | ||
54 | * to use. The faces are numbered | ||
55 | * horizontally. | ||
56 | */ | ||
57 | public void SetFace(String faceSet, int face) | ||
58 | { | ||
59 | throw new UnsupportedOperationException("Not yet implemented"); | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * Clears the face used when displaying a message | ||
64 | * | ||
65 | * See DisplayMessage() for more info | ||
66 | */ | ||
67 | public void EraseFace() | ||
68 | { | ||
69 | throw new UnsupportedOperationException("Not yet implemented"); | ||
70 | } | ||
71 | |||
72 | /** | ||
73 | * Sets a Switch to a [boolean] value | ||
74 | * | ||
75 | * @param switchID The Switch to set | ||
76 | * @param value The value to set the Switch to | ||
77 | */ | ||
78 | public void SetSwitch(String switchID, boolean value) | ||
79 | { | ||
80 | Game.getSaveFile().getSwitches().put(switchID, value); | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * Toggles a Switch's [boolean] value | ||
85 | * | ||
86 | * @param switchID The Switch to toggle | ||
87 | */ | ||
88 | public void ToggleSwitch(String switchID) | ||
89 | { | ||
90 | if (Game.getSaveFile().getSwitches().containsKey(switchID)) | ||
91 | { | ||
92 | Game.getSaveFile().getSwitches().put(switchID, !Game.getSaveFile().getSwitches().get(switchID)); | ||
93 | } else { | ||
94 | Game.getSaveFile().getSwitches().put(switchID, true); | ||
95 | } | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * Performs actions on the hero | ||
100 | * | ||
101 | * @param actions An array of MoveEvents to perform on the hero | ||
102 | */ | ||
103 | public void MoveEvent(MoveEvent[] actions) | ||
104 | { | ||
105 | MoveEvent(actions, Game.getHeroEvent()); | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * Performs actions on an event | ||
110 | * | ||
111 | * @param actions An array of MoveEvents to perform on the event | ||
112 | * @param ev The event to act upon | ||
113 | */ | ||
114 | public void MoveEvent(MoveEvent[] actions, Event ev) | ||
115 | { | ||
116 | new Thread(new MoveEventThread(ev, actions)).start(); | ||
117 | } | ||
118 | |||
119 | /** | ||
120 | * Waits until all previously called MoveEvent()s have finished | ||
121 | */ | ||
122 | public void MoveEventWait() | ||
123 | { | ||
124 | try { | ||
125 | MoveEventThread.moveEventWait.await(); | ||
126 | } catch (InterruptedException ex) { | ||
127 | Logger.getLogger(SpecialEvent.class.getName()).log(Level.SEVERE, null, ex); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * Triggers the Game Over sequence | ||
133 | * @throws Exception | ||
134 | */ | ||
135 | public void GameOver() throws Exception | ||
136 | { | ||
137 | throw new UnsupportedOperationException("Not yet implemented"); | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | * Returns the player to the Title Screen | ||
142 | * @throws Exception | ||
143 | */ | ||
144 | public void TitleScreen() throws Exception | ||
145 | { | ||
146 | throw new UnsupportedOperationException("Not yet implemented"); | ||
147 | } | ||
148 | |||
149 | /** | ||
150 | * Moves the player to a different map | ||
151 | * | ||
152 | * @param map The name of the map to move to | ||
153 | * @param x The X position on the map to move to | ||
154 | * @param y The Y position on the map to move to | ||
155 | * @throws java.lang.Exception | ||
156 | */ | ||
157 | public void Teleport(String map, int x, int y) throws Exception | ||
158 | { | ||
159 | throw new UnsupportedOperationException("Not yet implemented"); | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * Waits for a specified interval | ||
164 | * | ||
165 | * @param wait The time to wait in milliseconds | ||
166 | * @throws java.lang.InterruptedException | ||
167 | */ | ||
168 | public void Wait(int wait) throws InterruptedException | ||
169 | { | ||
170 | Thread.sleep(wait); | ||
171 | } | ||
172 | |||
173 | } | ||