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); }
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)); } }
public APICall <PurchaseConsumableOperation> PurchaseConsumable(string type, int count) { PurchaseConsumableOperation operation = new PurchaseConsumableOperation(type, count); return(new APICall <PurchaseConsumableOperation>(clubPenguinClient, operation)); }