Beispiel #1
0
    public JSONObject toJSONObject()
    {
        JSONObject json = new JSONObject(JSONObject.Type.OBJECT);

        json.AddField("itemId", this.ID);
        json.AddField("name", this.name);
        json.AddField("description", this.description);
        json.AddField("currency_itemId", this.currency_itemId);
        json.AddField("currency_amount", this.currency_amount);
        json.AddField("purchasableItem", marketInfo.toJSONObject());

        return(json);
    }
Beispiel #2
0
    public JSONObject toJSONObject()
    {
        JSONObject json = new JSONObject(JSONObject.Type.OBJECT);

        json.AddField("itemId", this.ID);
        json.AddField("name", this.name);
        json.AddField("description", this.description);
        if (this.goodType == ZFGood.GoodType.SingleUsePackVG)
        {
            json.AddField("good_itemId", this.good_itemId);
            json.AddField("good_amount", this.good_amount);
        }
        if (this.typePurchase == PurchaseInfo.Market)
        {
            json.AddField("purchasableItem", marketInfo.toJSONObject());
        }
        else if (this.typePurchase == PurchaseInfo.VirtualItem)
        {
            json.AddField("purchasableItem", virtualInfo.toJSONObject());
        }

        return(json);
    }