summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/StopRecordingAction.java
blob: 9b63a91f66b266cb19a266bc9ba7d030670cd98f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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();
      }
   }
}