本文整理汇总了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 ) );
}
示例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 ) );
}
示例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 ) );
//.........这里部分代码省略.........