package forager.events;

import java.io.IOException;

import galileo.event.Event;
import galileo.serialization.SerializationInputStream;
import galileo.serialization.SerializationOutputStream;

public class TaskSpec implements Event {

    public String[] command;

    public TaskSpec(String[] command) {
        this.command = command;
    }

    public String toString() {
        String str = "";
        for (String s : command) {
            str += s + " ";
        }
        return str;
    }

    @Deserialize
    public TaskSpec(SerializationInputStream in)
    throws IOException {
        int numArgs = in.readInt();
        command = new String[numArgs];
        for (int i = 0; i < numArgs; ++i) {
            command[i] = in.readString();
        }
    }

    @Override
    public void serialize(SerializationOutputStream out)
    throws IOException {
        out.writeInt(command.length);
        for (String s : command) {
            out.writeString(s);
        }
    }
}

@@ -229,16 +229,40 @@
 vent %7B%0A%0A
+    public long taskId;%0A
     publ
@@ -303,16 +303,29 @@
 askSpec(
+long taskId, 
 String%5B%5D
@@ -328,32 +328,62 @@
 ng%5B%5D command) %7B%0A
+        this.taskId = taskId;%0A
         this.com
@@ -458,16 +458,33 @@
  str = %22
+%5B%22 + taskId + %22%5D 
 %22;%0A     
@@ -661,32 +661,64 @@
 s IOException %7B%0A
+        taskId = in.readLong();%0A
         int numA
@@ -967,32 +967,63 @@
 s IOException %7B%0A
+        out.writeLong(taskId);%0A
         out.writ

Add identifier to task specifications