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


C++ ItemType::groupID方法代码示例

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


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

示例1: CelestialObjectRef

RefPtr<_Ty> CelestialObject::_LoadCelestialObject(ItemFactory &factory, uint32 celestialID,
	// InventoryItem stuff:
	const ItemType &type, const ItemData &data,
	// CelestialObject stuff:
	const CelestialObjectData &cData)
{
	// Our category is celestial; what to do next:
	switch( type.groupID() ) {
		///////////////////////////////////////
		// Solar system:
		///////////////////////////////////////
		case EVEDB::invGroups::Solar_System: {
			return SolarSystem::_LoadCelestialObject<SolarSystem>( factory, celestialID, type, data, cData );
		}

		///////////////////////////////////////
		// Station:
		///////////////////////////////////////
		case EVEDB::invGroups::Station: {
			return Station::_LoadCelestialObject<Station>( factory, celestialID, type, data, cData );
		}
	}

	// Create a generic one:
	return CelestialObjectRef( new CelestialObject( factory, celestialID, type, data, cData ) );
}
开发者ID:MurdockGT,项目名称:evemu-incursion,代码行数:26,代码来源:Celestial.cpp

示例2: OwnerRef

RefPtr<_Ty> Owner::_LoadOwner(ItemFactory &factory, uint32 ownerID,
	// InventoryItem stuff:
	const ItemType &type, const ItemData &data )
{
	// decide what to do next:
	switch( type.groupID() )
	{
		///////////////////////////////////////
		// Character:
		///////////////////////////////////////
		case EVEDB::invGroups::Character: {
			// create character
			return Character::_LoadOwner<Character>( factory, ownerID, type, data );
		}
	}

	// fallback to default:
	return OwnerRef( new Owner( factory, ownerID, type, data ) );
}
开发者ID:MurdockGT,项目名称:evemu-incursion,代码行数:19,代码来源:Owner.cpp

示例3: CargoContainerRef

RefPtr<_Ty> InventoryItem::_LoadItem(ItemFactory &factory, uint32 itemID,
    // InventoryItem stuff:
    const ItemType &type, const ItemData &data)
{
    // See what to do next:
    switch( type.categoryID() ) {
        //! TODO not handled.
        case EVEDB::invCategories::_System:
        case EVEDB::invCategories::Station:
        case EVEDB::invCategories::Material:
        case EVEDB::invCategories::Accessories:
        case EVEDB::invCategories::Module:
        case EVEDB::invCategories::Charge:
        case EVEDB::invCategories::Trading:
        case EVEDB::invCategories::Bonus:
        case EVEDB::invCategories::Commodity:
        case EVEDB::invCategories::Drone:
        case EVEDB::invCategories::Implant:
        case EVEDB::invCategories::Deployable:
        case EVEDB::invCategories::Structure:
        case EVEDB::invCategories::Reaction:
        case EVEDB::invCategories::Asteroid:
             break;
        ///////////////////////////////////////
        // Blueprint:
        ///////////////////////////////////////
        case EVEDB::invCategories::Blueprint: {
            return Blueprint::_LoadItem<Blueprint>( factory, itemID, type, data );
        }

        ///////////////////////////////////////
        // Entity:
        ///////////////////////////////////////
        case EVEDB::invCategories::Entity: {
            if( (type.groupID() == EVEDB::invGroups::Spawn_Container) )
                return CargoContainerRef( new CargoContainer( factory, itemID, type, data ) );
            else
				if( (type.groupID() >= EVEDB::invGroups::Asteroid_Angel_Cartel_Frigate
							&& type.groupID() <= EVEDB::invGroups::Deadspace_Serpentis_Frigate) 
							|| (type.groupID() >= 755 /* Asteroid Rogue Drone BattleCruiser */
							&& type.groupID() <= 761 /* Asteroid Rogue Drone Swarm */) 
							|| (type.groupID() >= 789 /* Asteroid Angel Cartel Commander Frigate */
							&& type.groupID() <= 814 /* Asteroid Serpentis Commander Frigate */)
							|| (type.groupID() >= 843 /* Asteroid Rogue Drone Commander BattleCruiser */
							&& type.groupID() <= 852 /* Asteroid Serpentis Commander Battleship */)
							|| (type.groupID() >= 959 /* Deadspace Sleeper Sleepless Sentinel */
							&& type.groupID() <= 987 /* Deadspace Sleeper Emergent Patroller */) )
					return InventoryItemRef( new InventoryItem(factory, itemID, type, data) );
				else
					return CelestialObjectRef( new CelestialObject( factory, itemID, type, data ) );
        }

        ///////////////////////////////////////
        // Celestial:
        ///////////////////////////////////////
        case EVEDB::invCategories::Celestial: {
            if( (type.groupID() == EVEDB::invGroups::Secure_Cargo_Container)
                || (type.groupID() == EVEDB::invGroups::Audit_Log_Secure_Container)
                || (type.groupID() == EVEDB::invGroups::Freight_Container)
                || (type.groupID() == EVEDB::invGroups::Cargo_Container)
                || (type.groupID() == EVEDB::invGroups::Wreck) )
                return CargoContainerRef( new CargoContainer( factory, itemID, type, data ) );
            else
                return CelestialObjectRef( new CelestialObject( factory, itemID, type, data ) );
        }

        ///////////////////////////////////////
        // Ship:
        ///////////////////////////////////////
        case EVEDB::invCategories::Ship: {
            return Ship::_LoadItem<Ship>( factory, itemID, type, data );
        }

        ///////////////////////////////////////
        // Skill:
        ///////////////////////////////////////
        case EVEDB::invCategories::Skill: {
            return Skill::_LoadItem<Skill>( factory, itemID, type, data );
        }

        ///////////////////////////////////////
        // Owner:
        ///////////////////////////////////////
        case EVEDB::invCategories::Owner: {
            return Owner::_LoadItem<Owner>( factory, itemID, type, data );
        }
    }

    // ItemCategory didn't do it, try ItemGroup:
    switch( type.groupID() ) {
        ///////////////////////////////////////
        // Station:
        ///////////////////////////////////////
        case EVEDB::invGroups::Station: {
            return Station::_LoadItem<Station>( factory, itemID, type, data );
        }
    }

    // Generic item, create one:
    return InventoryItemRef( new InventoryItem( factory, itemID, type, data ) );
//.........这里部分代码省略.........
开发者ID:careysky,项目名称:evemu_server,代码行数:101,代码来源:InventoryItem.cpp


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