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); }
/* 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; }