EvEmu
0.8.4
11 September 2021
|
#include "ItemFactory.h"
Protected Member Functions | |
template<class _Ty > | |
const _Ty * | _GetType (uint16 typeID) |
template<class _Ty > | |
RefPtr< _Ty > | _GetItem (uint32 itemID) |
Protected Attributes | |
InventoryDB * | m_db |
Client * | m_pClient |
std::map< uint16, ItemType * > | m_types |
std::map< uint32, InventoryItemRef > | m_items |
std::map< uint32, InventoryItemRef > | m_staticItems |
std::map< uint32, InventoryItemRef > | m_dynamicItems |
Private Attributes | |
uint32 | m_nextNPCID |
uint32 | m_nextTempID |
uint32 | m_nextDroneID |
uint32 | m_nextMissileID |
Additional Inherited Members | |
![]() | |
static ItemFactory & | get () |
![]() | |
static std::shared_ptr < ItemFactory > | mInstance |
Definition at line 54 of file ItemFactory.h.
ItemFactory::ItemFactory | ( | ) |
Definition at line 48 of file ItemFactory.cpp.
ItemFactory::~ItemFactory | ( | ) |
Definition at line 58 of file ItemFactory.cpp.
References m_db, and SafeDelete().
Definition at line 288 of file ItemFactory.cpp.
References _log, item(), m_items, minAgent, and RefPtr< X >::StaticCast().
|
protected |
void ItemFactory::AddItem | ( | InventoryItemRef | iRef | ) |
Definition at line 129 of file ItemFactory.cpp.
References IsTempItem, m_items, minAgent, and sLog.
Referenced by SpawnAsteroid(), SpawnCargoContainer(), SpawnItem(), SpawnModule(), SpawnOffice(), SpawnProbe(), SpawnShip(), SpawnSkill(), SpawnStructure(), and SpawnWreckContainer().
void ItemFactory::Close | ( | ) |
Definition at line 84 of file ItemFactory.cpp.
References m_items, m_pClient, m_types, SafeDelete(), and sLog.
|
inline |
|
inline |
AsteroidItemRef ItemFactory::GetAsteroid | ( | uint32 | asteroidID | ) |
Definition at line 351 of file ItemFactory.cpp.
BlueprintRef ItemFactory::GetBlueprint | ( | uint32 | blueprintID | ) |
Definition at line 316 of file ItemFactory.cpp.
const BlueprintType * ItemFactory::GetBlueprintType | ( | uint16 | blueprintTypeID | ) |
Definition at line 268 of file ItemFactory.cpp.
CargoContainerRef ItemFactory::GetCargoContainer | ( | uint32 | containerID | ) |
Definition at line 366 of file ItemFactory.cpp.
CelestialObjectRef ItemFactory::GetCelestialObject | ( | uint32 | celestialID | ) |
Definition at line 331 of file ItemFactory.cpp.
CharacterRef ItemFactory::GetCharacter | ( | uint32 | characterID | ) |
Definition at line 321 of file ItemFactory.cpp.
const CharacterType * ItemFactory::GetCharacterType | ( | uint16 | characterTypeID | ) |
Definition at line 272 of file ItemFactory.cpp.
Referenced by GetCharacterTypeByBloodline().
const CharacterType * ItemFactory::GetCharacterTypeByBloodline | ( | uint16 | bloodlineID | ) |
Definition at line 276 of file ItemFactory.cpp.
References GetCharacterType(), and InventoryDB::GetCharacterTypeByBloodline().
Definition at line 171 of file ItemFactory.cpp.
References RefPtr< X >::get(), GetItem(), IsValidLocation, and m_items.
InventoryItemRef ItemFactory::GetInventoryItemFromID | ( | uint32 | itemID, |
bool | load = true |
||
) |
Definition at line 190 of file ItemFactory.cpp.
References GetItem(), and m_items.
InventoryItemRef ItemFactory::GetItem | ( | uint32 | itemID | ) |
Definition at line 311 of file ItemFactory.cpp.
References itemID().
Referenced by GetInventoryFromId(), GetInventoryItemFromID(), GetItemContainer(), and GetItemContainerInventory().
InventoryItemRef ItemFactory::GetItemContainer | ( | uint32 | itemID, |
bool | load = true |
||
) |
Definition at line 202 of file ItemFactory.cpp.
References RefPtr< X >::get(), GetItem(), and m_items.
Definition at line 226 of file ItemFactory.cpp.
References RefPtr< X >::get(), GetItem(), and m_items.
ModuleItemRef ItemFactory::GetModuleItem | ( | uint32 | moduleID | ) |
Definition at line 376 of file ItemFactory.cpp.
uint32 ItemFactory::GetNextDroneID | ( | ) |
uint32 ItemFactory::GetNextMissileID | ( | ) |
uint32 ItemFactory::GetNextNPCID | ( | ) |
Definition at line 157 of file ItemFactory.cpp.
References m_nextNPCID.
uint32 ItemFactory::GetNextTempID | ( | ) |
Definition at line 146 of file ItemFactory.cpp.
References m_nextTempID, PLANET_PIN_ID, and TEMP_ENTITY_ID.
StationOfficeRef ItemFactory::GetOffice | ( | uint32 | officeID | ) |
Definition at line 356 of file ItemFactory.cpp.
ProbeItemRef ItemFactory::GetProbeItem | ( | uint32 | probeID | ) |
Definition at line 381 of file ItemFactory.cpp.
ShipItemRef ItemFactory::GetShip | ( | uint32 | shipID | ) |
Definition at line 326 of file ItemFactory.cpp.
Definition at line 346 of file ItemFactory.cpp.
References skillID().
SolarSystemRef ItemFactory::GetSolarSystem | ( | uint32 | solarSystemID | ) |
Definition at line 336 of file ItemFactory.cpp.
StationItemRef ItemFactory::GetStationItem | ( | uint32 | stationID | ) |
Definition at line 341 of file ItemFactory.cpp.
const StationType * ItemFactory::GetStationType | ( | uint16 | stationTypeID | ) |
Definition at line 283 of file ItemFactory.cpp.
StructureItemRef ItemFactory::GetStructure | ( | uint32 | structureID | ) |
Definition at line 361 of file ItemFactory.cpp.
Definition at line 264 of file ItemFactory.cpp.
|
inline |
WreckContainerRef ItemFactory::GetWreckContainer | ( | uint32 | containerID | ) |
Definition at line 371 of file ItemFactory.cpp.
int ItemFactory::Initialize | ( | ) |
Definition at line 63 of file ItemFactory.cpp.
References ManagerDB::DeleteSpawnedRats(), InventoryDB::DeleteTrackingCans(), DRONE_ID, m_db, m_items, m_nextDroneID, m_nextMissileID, m_nextNPCID, m_nextTempID, MISSILE_ID, NPC_ID, sConfig, sLog, and TEMP_ENTITY_ID.
void ItemFactory::RemoveItem | ( | uint32 | itemID | ) |
Definition at line 141 of file ItemFactory.cpp.
References m_items.
void ItemFactory::SaveItems | ( | ) |
Definition at line 100 of file ItemFactory.cpp.
References Inv::SaveData::contraband, Inv::SaveData::customInfo, InventoryDB::DeleteTrackingCans(), Inv::SaveData::flag, GetTimeMSeconds(), IsPlayerItem, Inv::SaveData::itemID, items, Inv::SaveData::locationID, m_items, Inv::SaveData::ownerID, Inv::SaveData::position, Inv::SaveData::quantity, ItemDB::SaveItems(), sConfig, Inv::SaveData::singleton, sLog, and Inv::SaveData::typeID.
|
inline |
AsteroidItemRef ItemFactory::SpawnAsteroid | ( | ItemData & | idata, |
AsteroidData & | adata | ||
) |
Definition at line 431 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and AsteroidItem::Spawn().
CargoContainerRef ItemFactory::SpawnCargoContainer | ( | ItemData & | data | ) |
Definition at line 449 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and CargoContainer::Spawn().
CharacterRef ItemFactory::SpawnCharacter | ( | CharacterData & | charData, |
CorpData & | corpData | ||
) |
Definition at line 400 of file ItemFactory.cpp.
References Character::Spawn().
InventoryItemRef ItemFactory::SpawnItem | ( | ItemData & | data | ) |
Definition at line 387 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and InventoryItem::Spawn().
ModuleItemRef ItemFactory::SpawnModule | ( | ItemData & | data | ) |
Definition at line 467 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and ModuleItem::Spawn().
StationOfficeRef ItemFactory::SpawnOffice | ( | ItemData & | idata, |
OfficeData & | odata | ||
) |
Definition at line 440 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and StationOffice::Spawn().
ProbeItemRef ItemFactory::SpawnProbe | ( | ItemData & | data | ) |
Definition at line 476 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and ProbeItem::Spawn().
ShipItemRef ItemFactory::SpawnShip | ( | ItemData & | data | ) |
Definition at line 405 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and ShipItem::Spawn().
creates new InventoryItem, saves to db, caches it and returns a RefPtr.
[in] | data | Item data (for entity table). |
[in] | charData | Character data. |
[in] | corpData | Character's corporation-membership data. |
Definition at line 413 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and Skill::Spawn().
StructureItemRef ItemFactory::SpawnStructure | ( | ItemData & | data | ) |
Definition at line 422 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and StructureItem::Spawn().
InventoryItemRef ItemFactory::SpawnTempItem | ( | ItemData & | data | ) |
Definition at line 395 of file ItemFactory.cpp.
References InventoryItem::SpawnTemp().
WreckContainerRef ItemFactory::SpawnWreckContainer | ( | ItemData & | data | ) |
Definition at line 458 of file ItemFactory.cpp.
References AddItem(), RefPtr< X >::get(), and WreckContainer::Spawn().
|
inline |
|
protected |
Definition at line 140 of file ItemFactory.h.
Referenced by db(), Initialize(), and ~ItemFactory().
|
protected |
Definition at line 146 of file ItemFactory.h.
|
protected |
Definition at line 144 of file ItemFactory.h.
Referenced by _GetItem(), AddItem(), Close(), Count(), GetInventoryFromId(), GetInventoryItemFromID(), GetItemContainer(), GetItemContainerInventory(), Initialize(), RemoveItem(), and SaveItems().
|
private |
Definition at line 159 of file ItemFactory.h.
Referenced by GetNextDroneID(), and Initialize().
|
private |
Definition at line 160 of file ItemFactory.h.
Referenced by GetNextMissileID(), and Initialize().
|
private |
Definition at line 157 of file ItemFactory.h.
Referenced by GetNextNPCID(), and Initialize().
|
private |
Definition at line 158 of file ItemFactory.h.
Referenced by GetNextTempID(), and Initialize().
|
protected |
Definition at line 141 of file ItemFactory.h.
Referenced by Close(), GetUsingClient(), SetUsingClient(), and UnsetUsingClient().
|
protected |
Definition at line 145 of file ItemFactory.h.
Definition at line 143 of file ItemFactory.h.
Referenced by _GetType(), and Close().