示例#1
0
        //public static PacketKey responseKey(PacketKey original)
        //{
        //    var p = new PacketKey();
        //    p.parentValue = original.value;
        //    return p;
        //}

        //public bool isResponseOf(PacketKey other)
        //{
        //    return parentValue == other.value;
        //}

        public void addToJSON(JSONBuilder jb)
        {
            jb.beginItem();

            jb.addField("value");
            jb.addPrimitive(value.ToString());

            jb.endItem();
        }
示例#2
0
        public string pack()
        {
            JSONBuilder jb = new JSONBuilder();

            jb.beginItem();

            jb.addField("flavour");
            jb.addPrimitive(flavour.ToString());

            jb.addField("key");
            key.addToJSON(jb);

            if (flavour != Flavour.ECHO)
            {
                jb.addField("data");
                data.addToJSON(jb);
            }

            jb.endItem();

            return(jb.ToString());
        }
示例#3
0
 public void addToJSON(JSONBuilder jb)
 {
     jb.addPrimitive("Key", value);
 }
示例#4
0
 public void addToJSON(JSONBuilder jb)
 {
     jb.addPrimitive("Vec", vec);
     jb.addPrimitive("Mag", mag);
     jb.closeMe();
 }
示例#5
0
 public void addToJSON(JSONBuilder jb)
 {
     jb.addObject("ArmCursor", Cursor);
     jb.addPrimitive("Time", Time);
     jb.closeMe();
 }
示例#6
0
 public void addToJSON(JSONBuilder jb)
 {
     jb.addPrimitive("Pos", Pos);
     jb.addPrimitive("Dir", Dir);
     jb.closeMe();
 }