/* */ package NET.worlds.console; /* */ /* */ import NET.worlds.core.Std; /* */ import java.io.DataInputStream; /* */ import java.io.DataOutputStream; /* */ import java.io.IOException; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract class BlackBoxCommand /* */ { /* */ int commandType; /* */ long startTime; /* */ BlackBoxCallback callback; /* 19 */ boolean waiting = false; /* */ /* */ void timestamp(long basetime) { /* 22 */ this.startTime = (Std.getFastTime() - basetime); /* */ } /* */ /* */ public boolean execute(BlackBoxCallback c) { /* 26 */ if (this.waiting) { /* 27 */ return false; /* */ } /* 29 */ this.callback = c; /* 30 */ if (c != null) { /* 31 */ this.waiting = true; /* */ } /* 33 */ return execute(); /* */ } /* */ /* */ abstract boolean execute(); /* */ /* */ void save(DataOutputStream dos) throws IOException { /* 39 */ dos.writeInt(this.commandType); /* 40 */ dos.writeLong(this.startTime); /* */ } /* */ /* */ void load(DataInputStream dis) throws IOException { /* 44 */ this.startTime = dis.readLong(); /* */ } /* */ /* */ void doCallback(boolean ok) { /* 48 */ if (this.callback != null) { /* 49 */ this.waiting = false; /* 50 */ this.callback.commandCompleted(this, ok); /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\BlackBoxCommand.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */