/* */ 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 */