Ejemplo n.º 1
0
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 ) );
}
Ejemplo n.º 2
0
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 ) );
}
Ejemplo n.º 3
0
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 ) );
}