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


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

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


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

示例1: Merge

bool InventoryItem::Merge(InventoryItemRef to_merge, int32 qty, bool notify) {
    if(typeID() != to_merge->typeID()) {
        _log(ITEM__ERROR, "%s (%u): Asked to merge with %s (%u).", itemName().c_str(), itemID(), to_merge->itemName().c_str(), to_merge->itemID());
        return false;
    }
    if(locationID() != to_merge->locationID() || flag() != to_merge->flag()) {
        _log(ITEM__ERROR, "%s (%u) in location %u, flag %u: Asked to merge with item %u in location %u, flag %u.", itemName().c_str(), itemID(), locationID(), flag(), to_merge->itemID(), to_merge->locationID(), to_merge->flag());
        return false;
    }
    if(qty == 0)
        qty = to_merge->quantity();
    if(qty <= 0) {
        _log(ITEM__ERROR, "%s (%u): Asked to merge with %d units of item %u.", itemName().c_str(), itemID(), qty, to_merge->itemID());
        return false;
    }
    if(!AlterQuantity(qty, notify)) {
        _log(ITEM__ERROR, "%s (%u): Failed to add quantity %d.", itemName().c_str(), itemID(), qty);
        return false;
    }

    if(qty == to_merge->quantity()) {
        to_merge->Delete();
    } else if(!to_merge->AlterQuantity(-qty, notify)) {
        _log(ITEM__ERROR, "%s (%u): Failed to remove quantity %d.", to_merge->itemName().c_str(), to_merge->itemID(), qty);
        return false;
    }

    return true;
}
开发者ID:careysky,项目名称:evemu_server,代码行数:29,代码来源:InventoryItem.cpp

示例2: RemoveRig

void Ship::RemoveRig( InventoryItemRef item, uint32 inventoryID )
{
    m_ModuleManager->UnfitModule(item->itemID());

    //delete the item
    item->Delete();
}
开发者ID:eve-moo,项目名称:evemu_server,代码行数:7,代码来源:Ship.cpp

示例3: RemoveRig

void Ship::RemoveRig( InventoryItemRef item, uint32 inventoryID )
{
	m_ModuleManager->UninstallRig(item->itemID());

	//move the item to the void or w/e
	m_pOperator->MoveItem(item->itemID(), inventoryID, flagAutoFit);

	//delete the item
	item->Delete();
}
开发者ID:Logomorph,项目名称:evemu_crucible,代码行数:10,代码来源:Ship.cpp

示例4: DeleteContents

void Inventory::DeleteContents(ItemFactory &factory)
{
    LoadContents( factory );

    std::map<uint32, InventoryItemRef>::iterator cur, end;
    cur = mContents.begin();
    end = mContents.end();
    for(; cur != end; )
    {
        // Our "cur" iterator becomes invalid once RemoveItem
        // for its item is called, so we need to increment it
        // before calling Delete().
        InventoryItemRef i = cur->second;
        cur++;

        i->Delete();
    }

    mContents.clear();
}
开发者ID:Almamu,项目名称:evemu_incursion,代码行数:20,代码来源:Inventory.cpp

示例5: Command_unspawn

PyResult Command_unspawn( Client* who, CommandDB* db, PyServiceMgr* services, const Seperator& args )
{
    uint32 entityID = 0;
    uint32 itemID = 0;
    
	if( (args.argCount() < 3) || (args.argCount() > 3) )
		throw PyException( MakeCustomError("Correct Usage: /unspawn (entityID) (itemID), and for now (entityID) is unused, so just type 0, and use the itemID from the entity table for (itemID)") );
	
    if( !(args.isNumber( 1 )) )
		throw PyException( MakeCustomError( "Argument 1 should be an item entity ID" ) );

    if( !(args.isNumber( 2 )) )
		throw PyException( MakeCustomError( "Argument 2 should be an item item ID" ) );

    entityID = atoi( args.arg( 1 ).c_str() );
    itemID = atoi( args.arg( 2 ).c_str() );

	if( !who->IsInSpace() )
		throw PyException( MakeCustomError( "You must be in space to unspawn things." ) );

    // Search for the itemRef for itemID:
    InventoryItemRef itemRef = who->services().item_factory.GetItem( itemID );
    SystemEntity * entityRef = who->System()->get( itemID );

    // Actually do the unspawn using SystemManager's RemoveEntity:
    if( entityRef == NULL )
    {
        return new PyString( "Un-Spawn Failed: itemID not found." );
    }
    else
    {
        who->System()->RemoveEntity( entityRef );
        itemRef->Delete();
    }

    sLog.Log( "Command", "%s: Un-Spawned %u.", who->GetName(), itemID );

	return new PyString( "Un-Spawn successful." );
}
开发者ID:Almamu,项目名称:evemu_incursion,代码行数:39,代码来源:GMCommands.cpp

示例6: UnplugImplant

void Character::UnplugImplant( uint32 itemID )
{
	InventoryItemRef item = m_factory.GetItem( itemID );
	item->Delete();
	m_factory.db().LoadImplantsAndBoosters( itemID, m_implants, m_boosters );
}
开发者ID:adam3696,项目名称:evemu_apocrypha,代码行数:6,代码来源:Character.cpp


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