summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/PlaybackRecordingAction.java
blob: 7038fdeec30cb20c4017678a0f2bdbf1f8a3d724 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import NET.worlds.console.BlackBox;
/*    */ import NET.worlds.network.URL;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class PlaybackRecordingAction
/*    */   extends Action
/*    */ {
/* 14 */   private String filename = "home:record.rec";
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   public void setFilename(String m)
/*    */   {
/* 22 */     this.filename = m;
/*    */   }
/*    */   
/*    */   public Persister trigger(Event e, Persister seqId)
/*    */   {
/* 27 */     BlackBox.getInstance().play(URL.make(this.filename));
/* 28 */     return null;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public Object properties(int index, int offset, int mode, Object value)
/*    */     throws NoSuchPropertyException
/*    */   {
/* 37 */     Object ret = null;
/* 38 */     switch (index - offset) {
/*    */     case 0: 
/* 40 */       if (mode == 0) {
/* 41 */         ret = StringPropertyEditor.make(
/* 42 */           new Property(this, index, "Filename"));
/* 43 */       } else if (mode == 1) {
/* 44 */         ret = new String(this.filename);
/* 45 */       } else if (mode == 2)
/* 46 */         this.filename = ((String)value);
/* 47 */       break;
/*    */     default: 
/* 49 */       ret = super.properties(index, offset + 1, mode, value);
/*    */     }
/* 51 */     return ret;
/*    */   }
/*    */   
/* 54 */   private static Object classCookie = new Object();
/*    */   
/*    */   public void saveState(Saver s) throws IOException
/*    */   {
/* 58 */     s.saveVersion(1, classCookie);
/* 59 */     super.saveState(s);
/* 60 */     s.saveString(this.filename);
/*    */   }
/*    */   
/*    */   public void restoreState(Restorer r) throws IOException, TooNewException
/*    */   {
/* 65 */     switch (r.restoreVersion(classCookie)) {
/*    */     case 1: 
/* 67 */       super.restoreState(r);
/* 68 */       this.filename = r.restoreString();
/* 69 */       break;
/*    */     default: 
/* 71 */       throw new TooNewException();
/*    */     }
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\PlaybackRecordingAction.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */