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


C++ ItemType::isContainer方法代码示例

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


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

示例1: getDescription


//.........这里部分代码省略.........
						s << "protection ";
					} else {
						s << ", ";
					}

					s << getCombatName(indexToCombatType(i)) << " " << std::showpos << it.abilities->absorbPercent[i] << std::noshowpos << "%";
				}
			} else {
				if (begin) {
					begin = false;
					s << " (";
				} else {
					s << ", ";
				}

				s << "protection all " << std::showpos << show << std::noshowpos << "%";
			}

			if (it.abilities->speed) {
				if (begin) {
					begin = false;
					s << " (";
				} else {
					s << ", ";
				}

				s << "speed " << std::showpos << (int32_t)(it.abilities->speed / 2) << std::noshowpos;
			}
		}

		if (!begin) {
			s << ")";
		}
	} else if (it.isContainer()) {
		s << " (Vol:" << (int32_t)it.maxItems << ")";
	} else {
		bool found = true;

		if (it.abilities) {
			if (it.abilities->speed > 0) {
				s << " (speed " << std::showpos << (it.abilities->speed / 2) << std::noshowpos << ")";
			} else if (it.abilities && hasBitSet(CONDITION_DRUNK, it.abilities->conditionSuppressions)) {
				s << " (hard drinking)";
			} else if (it.abilities->invisible) {
				s << " (invisibility)";
			} else if (it.abilities->regeneration) {
				s << " (faster regeneration)";
			} else if (it.abilities->manaShield) {
				s << " (mana shield)";
			} else {
				found = false;
			}
		} else {
			found = false;
		}

		if (!found) {
			if (it.isKey()) {
				s << " (Key:" << (item ? (int32_t)item->getActionId() : 0) << ")";
			} else if (it.isFluidContainer()) {
				if (subType > 0) {
					const std::string& itemName = items[subType].name;
					s << " of " << (itemName.length() ? itemName : "unknown");
				} else {
					s << ". It is empty";
				}
开发者ID:HeberPcL,项目名称:forgottenserver,代码行数:67,代码来源:item.cpp

示例2: getDescription


//.........这里部分代码省略.........
				s << "faster regeneration";
			}

			if(it.abilities->manaShield)
			{
				if(begin)
				{
					begin = false;
					s << " (";
				}
				else
					s << ", ";

				s << "mana shield";
			}

			if(hasBitSet(CONDITION_DRUNK, it.abilities->conditionSuppressions))
			{
				if(begin)
				{
					begin = false;
					s << " (";
				}
				else
					s << ", ";

				s << "hard drinking";
			}

			if(!begin)
				s << ")";
		}
	}
	else if(it.isContainer())
		s << " (Vol:" << (int32_t)it.maxItems << ")";
	else if(it.isKey())
		s << " (Key:" << (item ? (int32_t)item->getActionId() : 0) << ")";
	else if(it.isFluidContainer())
	{
		if(subType > 0)
			s << " of " << (items[subType].name.length() ? items[subType].name : "unknown");
		else
			s << ". It is empty";
	}
	else if(it.isSplash())
	{
		s << " of ";
		if(subType > 0 && items[subType].name.length())
			s << items[subType].name;
		else
			s << "unknown";
	}
	else if(it.allowDistRead)
	{
		s << "." << std::endl;
		if(item && !item->getText().empty())
		{
			if(lookDistance <= 4)
			{
				if(!item->getWriter().empty())
				{
					s << item->getWriter() << " wrote";
					time_t date = item->getDate();
					if(date > 0)
						s << " on " << formatDate(date);
开发者ID:Elexonic,项目名称:otxserver,代码行数:66,代码来源:item.cpp

示例3: getDescription


//.........这里部分代码省略.........
				if(tmp > 99)
					s << "whole";
				else if(tmp >= 75)
					s << "huge";
				else if(tmp >= 50)
					s << "medium";
				else if(tmp >= 25)
					s << "small";
				else
					s << "tiny";
			}
			else
				s << "mixed";

			s << " damage";
		}

		if(it.abilities.speed)
		{
			if(begin)
			{
				begin = false;
				s << " (";
			}
			else
				s << ", ";

			s << "speed " << std::showpos << (int32_t)(it.abilities.speed / 2) << std::noshowpos;
		}

		if(!begin)
			s << ")";
	}
	else if(it.isContainer())
		s << " (Vol:" << (int32_t)it.maxItems << ")";
	else if(it.isKey())
		s << " (Key:" << (item ? (int32_t)item->getActionId() : 0) << ")";
	else if(it.isFluidContainer())
	{
		if(subType > 0)
			s << " of " << (items[subType].name.length() ? items[subType].name : "unknown");
		else
			s << ". It is empty";
	}
	else if(it.isSplash())
	{
		s << " of ";
		if(subType > 0 && items[subType].name.length())
			s << items[subType].name;
		else
			s << "unknown";
	}
	else if(it.allowDistRead)
	{
		s << std::endl;
		if(item && !item->getText().empty())
		{
			if(lookDistance <= 4)
			{
				if(!item->getWriter().empty())
				{
					s << item->getWriter() << " wrote";
					time_t date = item->getDate();
					if(date > 0)
						s << " on " << formatDate(date);
开发者ID:alexisjojo,项目名称:darkkonia,代码行数:66,代码来源:item.cpp

示例4: getDescription


//.........这里部分代码省略.........
			}

			s << "speed " << std::showpos << (int32_t)(it.abilities.speed / 2) << std::noshowpos;
			// last desc... same thing as the first
			//prevDesc = true;
		}

		s << ").";
	}
	else if (it.isFluidContainer())
	{
		if (subType > 0)
		{
			s << " of " << items[subType].name << ".";
		}
		else
		{
			s << ". It is empty.";
		}
	}
	else if (it.isSplash())
	{
		s << " of ";

		if (subType > 0)
		{
			s << items[subType].name << ".";
		}
		else
		{
			s << items[1].name << ".";
		}
	}
	else if (it.isContainer())
	{
		s << " (Vol:" << (int32_t)it.maxItems << ").";
	}
	else if (it.isKey())
	{
		if (item)
		{
			s << " (Key:" << (int32_t)item->getActionId() << ").";
		}
		else
		{
			s << " (Key:0).";
		}
	}
	else if (it.allowDistRead)
	{
		s << std::endl;

		if (item && item->getText() != "")
		{
			if (lookDistance <= 4)
			{
				if (item->getWriter().length())
				{
					s << item->getWriter() << " wrote";
					time_t wDate = item->getWrittenDate();

					if (wDate > 0)
					{
						char date[16];
						formatDateShort(wDate, date);
						s << " on " << date;
开发者ID:edubart,项目名称:otserv,代码行数:67,代码来源:item.cpp

示例5: getDescription


//.........这里部分代码省略.........
	else if (it.armor != 0 || it.abilities.absorb.any()){
		if (it.showCharges){
			if (subType > 1){
				s << " that has " << (int32_t)subType << " charges left";
			}
			else{
				s << " that has 1 charge left";
			}
		}
		
		if (it.armor != 0){
			s << " (Arm:" << it.armor << ")";
		}
		
		s << ".";
	}
	else if (it.isFluidContainer()){
		if (item && item->getFluidType() != 0){
			s << " of " << items[item->getFluidType()].name << ".";
		}
		else{
			s << ". It is empty.";
		}
	}
	else if (it.isSplash()){
		s << " of ";
		if (item && item->getFluidType() != 0){
			s << items[item->getFluidType()].name << ".";
		}
		else{
			s << items[1].name;
		}
	}
	else if (it.isContainer()){
		s << " (Vol:" << (int)it.maxItems << ").";
	}
	else if (it.isKey()){
		if (item){
			s << " (Key:" << (int)item->getActionId() << ").";
		}
		else{
			s << " (Key:" << (int)0 << ").";
		}
	}
	else if (it.allowDistRead){
		s << "." << std::endl;

		if (item && item->getText() != ""){
			if (lookDistance <= 4){
				if (item->getWriter().length()){
					s << item->getWriter() << " wrote: ";
				}
				else{
					s << "You read: ";
				}

				s << item->getText();
			}
			else{
				s << "You are too far away to read it.";
			}
		}
		else{
			s << "Nothing is written on it.";
		}
	}
开发者ID:TwistedScorpio,项目名称:OTHire,代码行数:67,代码来源:item.cpp

示例6: getDescription


//.........这里部分代码省略.........
				if(!isBegin){
					s << ",";
				}
				s << " mana drain " << std::showpos << it.abilities.absorbPercentManaDrain << std::noshowpos << "%";
				isBegin = false;
			}
			if(it.abilities.absorbPercentPhysical != 0){
				if(!isBegin){
					s << ",";
				}
				s << " physical " << std::showpos << it.abilities.absorbPercentPhysical << std::noshowpos << "%";
				isBegin = false;
			}
		}
		s << ").";
	}
	else if(it.isFluidContainer()){
		if(subType > 0){
			s << " of " << items[subType].name << ".";
		}
		else{
			s << ". It is empty.";
		}
	}
	else if(it.isSplash()){
		s << " of ";
		if(subType > 0){
			s << items[subType].name;
		}
		else{
			s << items[1].name;
		}
	}
	else if(it.isContainer()){
		s << " (Vol:" << (int)it.maxItems << ").";
	}
	else if(it.isKey()){
		if(item){
			s << " (Key:" << (int)item->getActionId() << ").";
		}
		else{
			s << " (Key:0).";
		}
	}
	else if(it.allowDistRead){
		s << std::endl;

		if(item && item->getText() != ""){
			if(lookDistance <= 4){
				if(item->getWriter().length()){
					s << item->getWriter() << " wrote";

					time_t wDate = item->getWrittenDate();
					if(wDate > 0){
						char date[16];
						formatDate2(wDate, date);
						s << " on " << date;
					}
					s << ": ";
				}
				else{
					s << "You read: ";
				}

				s << item->getText();
			}
开发者ID:cp1337,项目名称:devland,代码行数:67,代码来源:item.cpp


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