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


C++ CInventoryOwner::object_id方法代码示例

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


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

示例1: ChangeGoodwill

void CScriptGameObject::ChangeGoodwill(int delta_goodwill, CScriptGameObject* pWhoToSet)
{
	CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());

	if (!pInventoryOwner) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"ChangeGoodwill available only for InventoryOwner");
		return ;
	}
	RELATION_REGISTRY().ChangeGoodwill(pInventoryOwner->object_id(), pWhoToSet->object().ID(), delta_goodwill);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:10,代码来源:script_game_object_inventory_owner.cpp

示例2: RELATION_REGISTRY

int	CScriptGameObject::GetGoodwill(CScriptGameObject* pToWho)
{
	CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());

	if (!pInventoryOwner) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"GetGoodwill available only for InventoryOwner");
		return 0;
	}
	return RELATION_REGISTRY().GetGoodwill(pInventoryOwner->object_id(), pToWho->object().ID());
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:10,代码来源:script_game_object_inventory_owner.cpp

示例3: SetCommunityGoodwill_obj

void CScriptGameObject::SetCommunityGoodwill_obj( LPCSTR community, int goodwill )
{
	CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());

	if (!pInventoryOwner) {
		ai().script_engine().script_log		(ScriptStorage::eLuaMessageTypeError,"SetCommunityGoodwill available only for InventoryOwner");
		return;
	}
	CHARACTER_COMMUNITY c;
	c.set( community );

	RELATION_REGISTRY().SetCommunityGoodwill( c.index(), pInventoryOwner->object_id(), goodwill );
}
开发者ID:2asoft,项目名称:xray,代码行数:13,代码来源:script_game_object_inventory_owner.cpp

示例4: MakeItemActive

void CScriptGameObject::MakeItemActive(CScriptGameObject* pItem)
{
	CInventoryOwner* owner			= smart_cast<CInventoryOwner*>(&object());
	CInventoryItem* item			= smart_cast<CInventoryItem*>(&pItem->object());
	u32 slot						= item->GetSlot();
	
	CInventoryItem* item_in_slot	= owner->inventory().ItemFromSlot(slot);

	NET_Packet						P;
	if(item_in_slot)
	{
		CGameObject::u_EventGen		(P, GEG_PLAYER_ITEM2RUCK, owner->object_id());
		P.w_u16						(item_in_slot->object().ID());
		CGameObject::u_EventSend	(P);
	}
	CGameObject::u_EventGen			(P, GEG_PLAYER_ITEM2SLOT, owner->object_id());
	P.w_u16							(item->object().ID());
	CGameObject::u_EventSend		(P);

	CGameObject::u_EventGen			(P, GEG_PLAYER_ACTIVATE_SLOT, owner->object_id());
	P.w_u32							(slot);
	CGameObject::u_EventSend		(P);

}
开发者ID:2asoft,项目名称:xray,代码行数:24,代码来源:script_game_object_inventory_owner.cpp


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