private void onClaimRewardResponse(ClaimRewardOperation operation, HttpResponse httpResponse)
    {
        Reward reward = operation.ResponseBody.reward.ToReward();

        if (!(reward?.isEmpty() ?? true))
        {
            Service.Get <EventDispatcher>().DispatchEvent(new RewardServiceEvents.MyRewardEarned(RewardSource.CLAIMABLE_REWARD, "ClaimableReward", reward));
            Service.Get <EventDispatcher>().DispatchEvent(new RewardServiceEvents.ClaimedReward(reward));
        }
        else
        {
            Service.Get <EventDispatcher>().DispatchEvent(new RewardServiceEvents.ClaimableRewardFail(operation.RewardId));
        }
        handleCPResponse(operation.ResponseBody);
    }
    protected override void SetOfflineData(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
    {
        ClaimRewardResponse responseBody = new ClaimRewardResponse();

        ClaimRewardOperation.ClaimReward(RewardId, out responseBody, offlineDatabase, offlineDefinitions);
    }
 protected override void PerformOfflineAction(OfflineDatabase offlineDatabase, IOfflineDefinitionLoader offlineDefinitions)
 {
     claimed = ClaimRewardOperation.ClaimReward(RewardId, out ResponseBody, offlineDatabase, offlineDefinitions);
 }
 private void onClaimRewardFailed(ClaimRewardOperation operation, HttpResponse httpResponse)
 {
     Service.Get <EventDispatcher>().DispatchEvent(new RewardServiceEvents.ClaimableRewardFail(operation.RewardId));
     handleCPResponseError(operation, httpResponse);
 }
Esempio n. 5
0
    public APICall <ClaimRewardOperation> ClaimReward(int rewardId)
    {
        ClaimRewardOperation operation = new ClaimRewardOperation(rewardId);

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