summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/PosableAction.java
blob: 6fd70ae028464c53ac0c3a37f949fe573db4c975 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class PosableAction
/*    */   extends Action
/*    */ {
/* 22 */   private String action = "wave";
/*    */   
/*    */ 
/*    */   public PosableAction() {}
/*    */   
/*    */ 
/*    */   public PosableAction(String action)
/*    */   {
/* 30 */     this.action = action;
/* 31 */     this.rightMenuLabel = action;
/*    */   }
/*    */   
/*    */   public Persister trigger(Event e, Persister seqID)
/*    */   {
/* 36 */     SuperRoot o = getOwner();
/* 37 */     if ((o instanceof PosableShape)) {
/* 38 */       ((PosableShape)o).animate(this.action);
/* 39 */     } else if ((o instanceof Drone)) {
/* 40 */       ((Drone)o).animate(this.action);
/* 41 */     } else if ((o instanceof Pilot)) {
/* 42 */       ((Pilot)o).animate(this.action);
/*    */     }
/* 44 */     return null;
/*    */   }
/*    */   
/*    */ 
/*    */   public Object properties(int index, int offset, int mode, Object value)
/*    */     throws NoSuchPropertyException
/*    */   {
/* 51 */     Object ret = null;
/* 52 */     switch (index - offset) {
/*    */     case 0: 
/* 54 */       if (mode == 0) {
/* 55 */         ret = StringPropertyEditor.make(
/* 56 */           new Property(this, index, "Action Name"));
/* 57 */       } else if (mode == 1) {
/* 58 */         ret = new String(this.action);
/* 59 */       } else if (mode == 2) {
/* 60 */         this.action = ((String)value);
/*    */       }
/* 62 */       break;
/*    */     default: 
/* 64 */       ret = super.properties(index, offset + 1, mode, value);
/*    */     }
/* 66 */     return ret;
/*    */   }
/*    */   
/*    */   public String toString() {
/* 70 */     return super.toString() + "[action " + this.action + "]";
/*    */   }
/*    */   
/*    */ 
/* 74 */   private static Object classCookie = new Object();
/*    */   
/*    */   public void saveState(Saver s) throws IOException
/*    */   {
/* 78 */     s.saveVersion(0, classCookie);
/* 79 */     super.saveState(s);
/*    */     
/* 81 */     s.saveString(this.action);
/*    */   }
/*    */   
/*    */   public void restoreState(Restorer r) throws IOException, TooNewException
/*    */   {
/* 86 */     switch (r.restoreVersion(classCookie)) {
/*    */     case 0: 
/* 88 */       super.restoreState(r);
/* 89 */       this.action = r.restoreString();
/* 90 */       break;
/*    */     
/*    */     default: 
/* 93 */       throw new TooNewException();
/*    */     }
/*    */   }
/*    */ }


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