예제 #1
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());
        }