summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/SetVisibleBumpableAction.java
blob: 7f0c2736240e12dc3dd7a504980f2c4c784fb171 (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
103
104
105
106
107
108
109
/*     */ package NET.worlds.scape;
/*     */ 
/*     */ import java.io.IOException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class SetVisibleBumpableAction
/*     */   extends Action
/*     */ {
/*  19 */   public boolean targetBumpable = true;
/*  20 */   public boolean targetVisible = true;
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public Persister trigger(Event e, Persister seqID)
/*     */   {
/*  29 */     Object owner = getOwner();
/*  30 */     if ((owner == null) || (!(owner instanceof WObject))) {
/*  31 */       return null;
/*     */     }
/*  33 */     WObject o = (WObject)owner;
/*     */     
/*  35 */     o.setBumpable(this.targetBumpable);
/*  36 */     o.setVisible(this.targetVisible);
/*     */     
/*  38 */     return null;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public Object properties(int index, int offset, int mode, Object value)
/*     */     throws NoSuchPropertyException
/*     */   {
/*  48 */     Object ret = null;
/*  49 */     switch (index - offset) {
/*     */     case 0: 
/*  51 */       if (mode == 0) {
/*  52 */         ret = BooleanPropertyEditor.make(
/*  53 */           new Property(this, index, "Target Bumpable"), 
/*  54 */           "No", "Yes");
/*  55 */       } else if (mode == 1) {
/*  56 */         ret = new Boolean(this.targetBumpable);
/*  57 */       } else if (mode == 2)
/*  58 */         this.targetBumpable = ((Boolean)value).booleanValue();
/*  59 */       break;
/*     */     case 1: 
/*  61 */       if (mode == 0) {
/*  62 */         ret = BooleanPropertyEditor.make(
/*  63 */           new Property(this, index, "Target Visible"), 
/*  64 */           "No", "Yes");
/*  65 */       } else if (mode == 1) {
/*  66 */         ret = new Boolean(this.targetVisible);
/*  67 */       } else if (mode == 2)
/*  68 */         this.targetVisible = ((Boolean)value).booleanValue();
/*  69 */       break;
/*     */     default: 
/*  71 */       ret = super.properties(index, offset + 2, mode, value);
/*     */     }
/*  73 */     return ret;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*  79 */   private static Object classCookie = new Object();
/*     */   
/*     */   public void saveState(Saver s) throws IOException
/*     */   {
/*  83 */     s.saveVersion(1, classCookie);
/*  84 */     super.saveState(s);
/*     */     
/*  86 */     s.saveBoolean(this.targetBumpable);
/*  87 */     s.saveBoolean(this.targetVisible);
/*     */   }
/*     */   
/*     */   public void restoreState(Restorer r) throws IOException, TooNewException
/*     */   {
/*  92 */     switch (r.restoreVersion(classCookie)) {
/*     */     case 1: 
/*  94 */       super.restoreState(r);
/*     */     case 0: 
/*  96 */       this.targetBumpable = r.restoreBoolean();
/*  97 */       this.targetVisible = r.restoreBoolean();
/*  98 */       break;
/*     */     default: 
/* 100 */       throw new TooNewException();
/*     */     }
/*     */   }
/*     */ }


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