summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/StopRecordingAction.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/scape/StopRecordingAction.java')
-rw-r--r--NET/worlds/scape/StopRecordingAction.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/NET/worlds/scape/StopRecordingAction.java b/NET/worlds/scape/StopRecordingAction.java
new file mode 100644
index 0000000..9b63a91
--- /dev/null
+++ b/NET/worlds/scape/StopRecordingAction.java
@@ -0,0 +1,36 @@
+package NET.worlds.scape;
+
+import NET.worlds.console.BlackBox;
+import java.io.IOException;
+
+public class StopRecordingAction extends Action {
+ private static Object classCookie = new Object();
+
+ @Override
+ public Persister trigger(Event e, Persister p) {
+ BlackBox.getInstance().stop();
+ return null;
+ }
+
+ @Override
+ public Object properties(int index, int offset, int mode, Object value) throws NoSuchPropertyException {
+ return super.properties(index, offset, mode, value);
+ }
+
+ @Override
+ public void saveState(Saver s) throws IOException {
+ s.saveVersion(1, classCookie);
+ super.saveState(s);
+ }
+
+ @Override
+ public void restoreState(Restorer r) throws IOException, TooNewException {
+ switch (r.restoreVersion(classCookie)) {
+ case 1:
+ super.restoreState(r);
+ return;
+ default:
+ throw new TooNewException();
+ }
+ }
+}