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


C++ InventoryItemRef::SaveAttributes方法代码示例

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


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

示例1: PlugImplant

void Character::PlugImplant( uint32 itemID )
{
	// Get itemID, change its location to characterID
	// and change the flag to flagImplant
	// So now its on character's brain
	InventoryItemRef item = m_factory.GetItem( itemID );

	// First of all check if we already have this
	Implants::iterator cur, end;

	cur = m_implants.begin();
	end = m_implants.end();

	for(; cur != end; cur++ )
	{
		InventoryItemRef implant = m_factory.GetItem( cur->itemID );

		if( implant == NULL ) return;

		// Ok, we already have this booster, return
		if( item->typeID() == implant->typeID() ) return;
	}

	item->MoveInto( *this, flagImplant );

	EvilNumber num = 1;
	item->SetAttribute( AttrIsOnline, num, true );
	item->SaveAttributes();

	cImplants i;
	i.itemID = itemID;

	m_implants.push_back( i );
}
开发者ID:adam3696,项目名称:evemu_apocrypha,代码行数:34,代码来源:Character.cpp

示例2: PlugBooster

void Character::PlugBooster( uint32 itemID )
{
	// Get itemID, change its location to characterID
	// and change the flag to flagBooster
	// So now its on character's brain
	InventoryItemRef item = m_factory.GetItem( itemID );

	// First of all check if we already have this
	Boosters::iterator cur, end;

	cur = m_boosters.begin();
	end = m_boosters.end();

	for(; cur != end; cur++ )
	{
		InventoryItemRef booster = m_factory.GetItem( cur->itemID );

		if( booster == NULL ) return;
		// Ok, we already have this booster, return
		if( item->typeID() == booster->typeID() )return;
	}

	item->MoveInto( *this, flagBooster );

	EvilNumber num = 1;
	item->SetAttribute( AttrIsOnline, num, true );
	item->SaveAttributes();

	cBoosters i;
	i.itemID = itemID;
	i.plugDate = Win32TimeNow();
	i.expiretime = item->GetAttribute( AttrBoosterDuration ).get_int();

	m_boosters.push_back( i );
}
开发者ID:adam3696,项目名称:evemu_apocrypha,代码行数:35,代码来源:Character.cpp


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