Example #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();
        }
Example #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());
        }