Ejemplo n.º 1
0
        private void onPurchaseConsumableResponse(PurchaseConsumableOperation operation, HttpResponse httpResponse)
        {
            PurchaseConsumableResponse response = operation.Response;

            Service.Get <EventDispatcher>().DispatchEvent(new RewardServiceEvents.MyAssetsReceived(response.assets));
            inventoryDataReturned(response.inventory);
            handleCPResponse(response);
        }
Ejemplo n.º 2
0
        private void onPurchaseConsumableError(PurchaseConsumableOperation operation, HttpResponse httpResponse)
        {
            ErrorResponse errorResponse = Service.Get <JsonService>().Deserialize <ErrorResponse>(httpResponse.Text);

            if (errorResponse.code == 707)
            {
                Service.Get <EventDispatcher>().DispatchEvent(default(ConsumableServiceErrors.NotEnoughCoins));
            }
            else
            {
                Service.Get <EventDispatcher>().DispatchEvent(default(ConsumableServiceErrors.Unknown));
            }
        }
Ejemplo n.º 3
0
    public APICall <PurchaseConsumableOperation> PurchaseConsumable(string type, int count)
    {
        PurchaseConsumableOperation operation = new PurchaseConsumableOperation(type, count);

        return(new APICall <PurchaseConsumableOperation>(clubPenguinClient, operation));
    }