int CCVirtualCurrencyPack::take(int amount, bool notify, CCError **error) {
     const char *currencyId = getCurrencyItemId()->getCString();
     CCVirtualCurrency *currency = dynamic_cast<CCVirtualCurrency *>(CCStoreInfo::sharedStoreInfo()->getItemByItemId(currencyId, error));
     
     if (currency == NULL) {
         CCSoomlaUtils::logError(TAG, __String::createWithFormat("VirtualCurrency with itemId: %s doesn't exist! Can't take this pack.", currencyId)->getCString());
         return 0;
     }
     
     return CCVirtualCurrencyStorage::getInstance()->remove(currency, getCurrencyAmount()->getValue() * amount, notify, error);
 }
Exemplo n.º 2
0
/* main program entry point */
int main() 
{
    double currencyAmount;

    displayGreeting();

    currencyAmount = getCurrencyAmount(CURRENCY_NAME);
    if (currencyAmount > 0.0) 
    {
        convertCurrency(CURRENCY_NAME, CURRENCY_EXCHANGE_RATE, currencyAmount);
    }

    return EXIT_SUCCESS;
}