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


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

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


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

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