summaryrefslogtreecommitdiff
path: root/NET/worlds/console/BlackBoxCommand.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/BlackBoxCommand.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/console/BlackBoxCommand.java')
-rw-r--r--NET/worlds/console/BlackBoxCommand.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/NET/worlds/console/BlackBoxCommand.java b/NET/worlds/console/BlackBoxCommand.java
new file mode 100644
index 0000000..6f4f5eb
--- /dev/null
+++ b/NET/worlds/console/BlackBoxCommand.java
@@ -0,0 +1,59 @@
+/* */ 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
+ */ \ No newline at end of file