本文整理汇总了C++中cGold::item_cost方法的典型用法代码示例。如果您正苦于以下问题:C++ cGold::item_cost方法的具体用法?C++ cGold::item_cost怎么用?C++ cGold::item_cost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cGold
的用法示例。
在下文中一共展示了cGold::item_cost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_events
void cScreenGangs::check_events()
{
if (g_InterfaceEvents.GetNumEvents() == 0) return; // no events means we can go home
if (g_InterfaceEvents.CheckButton(back_id)) // if it's the back button, pop the window off the stack and we're done
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckButton(ganghire_id))
{
hire_recruitable();
return;
}
if (g_InterfaceEvents.CheckButton(weaponup_id))
{
int cost = 0;
int *wlev = g_Gangs.GetWeaponLevel();
cost = tariff.goon_weapon_upgrade(*wlev);
if (g_Gold.item_cost(cost) == true)
{
*wlev += 1;
g_InitWin = true;
}
wlev = 0;
return;
}
int buynets = 0;
if (g_InterfaceEvents.CheckButton(netbuy_id)) buynets = 1;
if (g_InterfaceEvents.CheckButton(netbuy10_id)) buynets = 10;
if (g_InterfaceEvents.CheckButton(netbuy20_id)) buynets = 20;
if (buynets > 0)
{
int cost = 0;
int amount = buynets;
int *nets = g_Gangs.GetNets();
if (((*nets) + buynets) > 60) amount = 60 - (*nets);
cost = tariff.nets_price(amount);
if (g_Gold.item_cost(cost) == true)
{
*nets += amount;
if (IsCheckboxOn(netautobuy_id)) g_Gangs.KeepNetStocked(*nets);
g_InitWin = true;
}
nets = 0;
buynets = 0;
return;
}
int buypots = 0;
if (g_InterfaceEvents.CheckButton(healbuy_id)) buypots = 1;
if (g_InterfaceEvents.CheckButton(healbuy10_id)) buypots = 10;
if (g_InterfaceEvents.CheckButton(healbuy20_id)) buypots = 20;
if (buypots > 0)
{
int cost = 0;
int amount = buypots;
int *potions = g_Gangs.GetHealingPotions();
if (((*potions) + buypots) > 200) amount = 200 - (*potions);
cost = tariff.healing_price(amount);
if (g_Gold.item_cost(cost) == true)
{
*potions += amount;
if (IsCheckboxOn(healautobuy_id)) g_Gangs.KeepHealStocked(*potions);
g_InitWin = true;
}
potions = 0;
buypots = 0;
return;
}
if (g_InterfaceEvents.CheckCheckbox(netautobuy_id))
{
int *nets = g_Gangs.GetNets();
g_Gangs.KeepNetStocked(IsCheckboxOn(netautobuy_id) ? *nets : 0);
}
if (g_InterfaceEvents.CheckCheckbox(healautobuy_id))
{
int *potions = g_Gangs.GetHealingPotions();
g_Gangs.KeepHealStocked(IsCheckboxOn(healautobuy_id) ? *potions : 0);
}
if (g_InterfaceEvents.CheckButton(gangfire_id))
{
selection = GetLastSelectedItemFromList(ganglist_id);
if (selection != -1)
{
g_Gangs.FireGang(selection);
g_InitWin = true;
}
return;
}
if (g_InterfaceEvents.CheckListbox(recruitlist_id))
{
string ClickedHeader = HeaderClicked(recruitlist_id);
if (ClickedHeader != "")
{
g_LogFile.ss() << "User clicked \"" << ClickedHeader << "\" column header on Recruit listbox" << endl; g_LogFile.ssend();
return;
}
//.........这里部分代码省略.........