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


C++ PropWriteStream::ADD_UINT8方法代码示例

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


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

示例1: serialize

bool ConditionAttributes::serialize(PropWriteStream& propWriteStream)
{
	if (!Condition::serialize(propWriteStream))
	{
		return false;
	}

	for (int32_t i = SKILL_FIRST; i <= SKILL_LAST; ++i)
	{
		propWriteStream.ADD_UINT8(CONDITIONATTR_SKILLS);
		propWriteStream.ADD_INT32(skills[i]);
	}

	for (int32_t i = SKILL_FIRST; i <= SKILL_LAST; ++i)
	{
		propWriteStream.ADD_UINT8(CONDITIONATTR_SKILLSPERCENT);
		propWriteStream.ADD_INT32(skillsPercent[i]);
	}

	for (int32_t i = STAT_FIRST; i <= STAT_LAST; ++i)
	{
		propWriteStream.ADD_UINT8(CONDITIONATTR_STATS);
		propWriteStream.ADD_INT32(stats[i]);
	}

	return true;
}
开发者ID:edubart,项目名称:otserv,代码行数:27,代码来源:condition.cpp

示例2: serializeAttr

bool Item::serializeAttr(PropWriteStream& propWriteStream) const
{
	if(isStackable() || isFluidContainer() || isSplash()){
		uint8_t _count = getSubType();
		propWriteStream.ADD_UINT8(ATTR_COUNT);
		propWriteStream.ADD_UINT8(_count);
	}

	if(hasCharges()){
		uint16_t _count = getCharges();
		propWriteStream.ADD_UINT8(ATTR_CHARGES);
		propWriteStream.ADD_UINT16(_count);
	}

	if(!isNotMoveable() /*moveable*/){
		uint16_t _actionId = getActionId();
		if(_actionId){
			propWriteStream.ADD_UINT8(ATTR_ACTION_ID);
			propWriteStream.ADD_UINT16(_actionId);
		}
	}

	const std::string& _text = getText();
	if(_text.length() > 0){
		propWriteStream.ADD_UINT8(ATTR_TEXT);
		propWriteStream.ADD_STRING(_text);
	}

	const std::string& _writer = getWriter();
	if(_writer.length() > 0){
		propWriteStream.ADD_UINT8(ATTR_WRITTENBY);
		propWriteStream.ADD_STRING(_writer);
	}

	const std::string& _specialDesc = getSpecialDescription();
	if(_specialDesc.length() > 0){
		propWriteStream.ADD_UINT8(ATTR_DESC);
		propWriteStream.ADD_STRING(_specialDesc);
	}

	if(hasAttribute(ATTR_ITEM_DURATION)){
		uint32_t duration = getDuration();
		propWriteStream.ADD_UINT8(ATTR_DURATION);
		propWriteStream.ADD_UINT32(duration);
	}

	uint32_t decayState = getDecaying();
	if(decayState == DECAYING_TRUE || decayState == DECAYING_PENDING){
		propWriteStream.ADD_UINT8(ATTR_DECAYING_STATE);
		propWriteStream.ADD_UINT8(decayState);
	}

	return true;
}
开发者ID:TwistedScorpio,项目名称:OTHire,代码行数:54,代码来源:item.cpp

示例3: serializeAttr

bool Teleport::serializeAttr(PropWriteStream& propWriteStream) const
{
	bool ret = Item::serializeAttr(propWriteStream);

	propWriteStream.ADD_UINT8(ATTR_TELE_DEST);

	propWriteStream.ADD_UINT16((uint16_t)destPos.x);
	propWriteStream.ADD_UINT16((uint16_t)destPos.y);
	propWriteStream.ADD_UINT8((uint8_t)destPos.z);
	return ret;
}
开发者ID:ChubNtuck,项目名称:avesta74,代码行数:11,代码来源:teleport.cpp

示例4: serialize

bool ConditionDamage::serialize(PropWriteStream& propWriteStream)
{
	if(!Condition::serialize(propWriteStream)){
		return false;
	}

	propWriteStream.ADD_UINT8(CONDITIONATTR_DELAYED);
	propWriteStream.ADD_UINT8((uint8_t)delayed);

	propWriteStream.ADD_UINT8(CONDITIONATTR_PERIODDAMAGE);
	propWriteStream.ADD_INT32(periodDamage);

	propWriteStream.ADD_UINT8(CONDITIONATTR_OWNER);
	propWriteStream.ADD_UINT32(owner);

	for(DamageList::const_iterator it = damageList.begin(); it != damageList.end(); ++it){
		propWriteStream.ADD_UINT8(CONDITIONATTR_INTERVALDATA);
		propWriteStream.ADD_INT32((*it).timeLeft);
		propWriteStream.ADD_INT32((*it).value);
		propWriteStream.ADD_INT32((*it).interval);
	}

	return true;
}
开发者ID:JoseEduardo,项目名称:otserv,代码行数:24,代码来源:condition.cpp


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