当前位置: 首页>>代码示例>>C++>>正文


C++ cClinicManager::GetNumBrothels方法代码示例

本文整理汇总了C++中cClinicManager::GetNumBrothels方法的典型用法代码示例。如果您正苦于以下问题:C++ cClinicManager::GetNumBrothels方法的具体用法?C++ cClinicManager::GetNumBrothels怎么用?C++ cClinicManager::GetNumBrothels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cClinicManager的用法示例。


在下文中一共展示了cClinicManager::GetNumBrothels方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: check_clinic

void cScreenTown::check_clinic(int ClinicNum)
{	// player clicked on one of the brothels
	if (g_Clinic.GetNumBrothels() == ClinicNum)
	{	// player doesn't own this brothel... can he buy it? 
		static_brothel_data *bck = clinic_data + ClinicNum;
		locale syslocale("");
		stringstream ss;
		ss.imbue(syslocale);

		if (!g_Gold.afford(bck->price) || g_Gangs.GetNumBusinessExtorted() < bck->business)
		{	// can't buy it
			ss << gettext("This building costs ") << bck->price << gettext(" gold and you need to control at least ") << bck->business << gettext(" businesses.");
			if (!g_Gold.afford(bck->price))
				ss << "\n" << gettext("You need ") << (bck->price - g_Gold.ival()) << gettext(" more gold to afford it.");
			if (g_Gangs.GetNumBusinessExtorted() < bck->business)
				ss << "\n" << gettext("You need to control ") << (bck->business - g_Gangs.GetNumBusinessExtorted()) << gettext(" more businesses.");
			g_MessageQue.AddToQue(ss.str(), 0);
		}
		else
		{	// can buy it
			ss << gettext("Do you wish to purchase this building for ") << bck->price << gettext(" gold? It has ") << bck->rooms << gettext(" rooms.");
			g_MessageQue.AddToQue(ss.str(), 2);
			g_ChoiceManager.CreateChoiceBox(224, 112, 352, 384, 0, 2, 32, 8);
			g_ChoiceManager.AddChoice(0, gettext("Buy It"), 0);
			g_ChoiceManager.AddChoice(0, gettext("Don't Buy It"), 1);
			g_ChoiceManager.SetActive(0);
			BuyClinic = ClinicNum;
		}
	}
	else
	{	// player owns this brothel... go to it
		g_Building = BUILDING_CLINIC;
		g_CurrClinic = ClinicNum;
		g_WinManager.push("Clinic Screen");
	}
}
开发者ID:belroshir,项目名称:crazys-wm-mod,代码行数:36,代码来源:cScreenTown.cpp


注:本文中的cClinicManager::GetNumBrothels方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。