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


C++ GenericModule::flag方法代码示例

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


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

示例1: RemoveModule

void ModuleContainer::RemoveModule(uint32 itemID)
{
    GenericModule * mod = GetModule(itemID);

    _removeModule(mod->flag(), mod);

    //delete the module
    delete mod;
    mod = NULL;
}
开发者ID:N3X15,项目名称:evemu_crucible,代码行数:10,代码来源:ModuleManager.cpp

示例2: RemoveModule

bool ModuleContainer::RemoveModule(uint32 itemID)
{
    GenericModule * mod = GetModule(itemID);

	if( mod == NULL )
		return false;	// NO module pointer found at this slot flag, DO NOT attempt to dereference

    _removeModule(mod->flag(), mod);

    //delete the module
    delete mod;
    mod = NULL;

	return true;
}
开发者ID:comet0,项目名称:evemu_server,代码行数:15,代码来源:ModuleManager.cpp

示例3: _fitModule

bool ModuleManager::_fitModule(InventoryItemRef item, EVEItemFlags flag)
{
    bool verifyFailed = false;
	GenericModule * mod;

	// First, check to see if this module item is already fitted, and if so, let's instruct ModuleContainer to move the module
	GenericModule * existingMod = m_Modules->GetModule(item->itemID());

	if( existingMod != NULL )
	{
		if( m_Modules->isSlotOccupied(flag) )
		{
			throw PyException( MakeUserError( "SlotAlreadyOccupied" ) );
			verifyFailed = true;
		}

		m_Modules->RemoveModule( existingMod->flag() );		// Remove this module from existing slot
		existingMod->getItem()->SetFlag( flag );			// Change item's flag to the NEW slot flag
		m_Modules->AddModule( flag, existingMod );			// Add this module back to the container at the NEW slot location
	}
	else
	{
		mod = ModuleFactory(item, ShipRef(m_Ship));

		// Set module's pointer to its owner ModuleManager's log object:
		mod->setLog(m_pLog);

		// Check for max turret modules allowed:
		if( mod->isTurretFitted() && (m_Modules->GetFittedTurretCount() == m_Ship->GetMaxTurrentHardpoints().get_int()) )
		{
			//std::map<std::string, PyRep *> args;
			//args["typename"] = new PyString(item->itemName().c_str());
			//args["portion"] = new PyInt(item->type().portionSize());

			throw PyException( MakeUserError( "NotEnoughTurretSlots" ) );
			verifyFailed = true;
		}
		// Check for max launcher modules allowed:
		if( mod->isLauncherFitted() && (m_Modules->GetFittedLauncherCount() == m_Ship->GetMaxLauncherHardpoints().get_int()) )
		{
			//std::map<std::string, PyRep *> args;
			//args["typename"] = new PyString(item->itemName().c_str());
			//args["portion"] = new PyInt(item->type().portionSize());

			throw PyException( MakeUserError( "NotEnoughLauncherSlots" ) );
			verifyFailed = true;
		}
		// Check for max modules of group allowed:
		else if( mod->isMaxGroupFitLimited() && (m_Modules->GetFittedModuleCountByGroup(item->groupID()) == mod->getItem()->GetAttribute(AttrMaxGroupFitted).get_int()) )
		{
			//std::map<std::string, PyRep *> args;
			//args["typename"] = new PyString(item->itemName().c_str());
			//args["portion"] = new PyInt(item->type().portionSize());

			throw PyException( MakeUserError( "CantFitTooManyByGroup" ) );
			verifyFailed = true;
		}
		else
		{
			// Fit Module now that all checks have passed:
			m_Modules->AddModule(flag, mod);
		}
	}

    if( verifyFailed )
    {
        if( mod != NULL )
			delete mod;
        return false;
    }
    else
        return true;
}
开发者ID:comet0,项目名称:evemu_server,代码行数:73,代码来源:ModuleManager.cpp


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