EvEmu
0.8.4
11 September 2021
|
#include "Inventory.h"
Protected Member Functions | |
bool | GetItems (OwnerData od, std::vector< uint32 > &into) |
void | List (CRowSet *into, EVEItemFlags flag, uint32 ownerID=0) const |
Protected Attributes | |
InventoryDB | m_db |
InventoryItemRef | m_self |
Private Member Functions | |
std::vector< InventoryItemRef > | SortVector (std::vector< InventoryItemRef > &itemVec) |
Private Attributes | |
bool | mContentsLoaded |
uint32 | m_myID |
std::map< EVEItemFlags, double > | m_itemsByFlag |
std::map< uint32, InventoryItemRef > | mContents |
std::multimap< uint8, InventoryItemRef > | m_contentsByFlag |
Friends | |
class | InventoryItem |
Definition at line 37 of file Inventory.h.
Inventory::Inventory | ( | InventoryItemRef | iRef | ) |
|
inlinevirtualnoexcept |
Definition at line 42 of file Inventory.h.
void Inventory::AddItem | ( | InventoryItemRef | iRef | ) |
Definition at line 203 of file Inventory.cpp.
References _log, flagSkill, flagStructureActive, RefPtr< X >::get(), EVEDB::invTypes::InfrastructureHub, IsCharacterID, m_contentsByFlag, m_myID, m_self, mContents, sDataMgr, and EVEDB::invCategories::Skill.
Referenced by InventoryItem::AddItem(), and LoadContents().
|
inline |
Definition at line 63 of file Inventory.h.
References mContents.
bool Inventory::ContainsTypeByFlag | ( | uint16 | typeID, |
EVEItemFlags | flag = flagNone |
||
) | const |
Definition at line 561 of file Inventory.cpp.
References GetItemsByFlag().
Definition at line 526 of file Inventory.cpp.
References mContents.
Referenced by StructureSE::SetAnchor().
bool Inventory::ContainsTypeQtyByFlag | ( | uint16 | typeID, |
EVEItemFlags | flag = flagNone , |
||
uint32 | qty = 0 |
||
) | const |
Definition at line 542 of file Inventory.cpp.
References GetItemsByFlag().
Referenced by ActiveModule::CanActivate(), and ActiveModule::DoCycle().
|
inline |
Definition at line 62 of file Inventory.h.
References mContentsLoaded.
Referenced by ShipItem::GetChargeState(), Character::GetCharInfo(), and ShipItem::GetShipState().
void Inventory::DeleteContents | ( | ) |
Definition at line 273 of file Inventory.cpp.
References m_contentsByFlag, mContents, and mContentsLoaded.
Referenced by StructureItem::Delete(), CargoContainer::Delete(), ShipItem::Delete(), WreckContainer::Delete(), and Character::Delete().
InventoryItemRef Inventory::FindFirstByFlag | ( | EVEItemFlags | flag | ) | const |
InventoryItemRef Inventory::GetByID | ( | uint32 | id | ) | const |
Definition at line 415 of file Inventory.cpp.
References mContents.
Referenced by SystemManager::GetContainerFromInventory(), StationItem::GetContainerFromInventory(), RepairService::GetDamageReports(), SystemManager::GetShipFromInventory(), StationItem::GetShipFromInventory(), and SystemManager::GetStationFromInventory().
InventoryItemRef Inventory::GetByTypeFlag | ( | uint32 | typeID, |
EVEItemFlags | flag | ||
) | const |
Definition at line 444 of file Inventory.cpp.
References m_contentsByFlag.
Referenced by Client::ContainsTypeQty(), ActiveModule::DoCycle(), Character::GetSkill(), InventoryItem::MergeTypesInCargo(), Client::RemoveMissionItem(), and ModuleManager::UnloadCharge().
float Inventory::GetCapacity | ( | EVEItemFlags | flag | ) | const |
Definition at line 642 of file Inventory.cpp.
References _log, AttrAmmoCapacity, AttrAmmoHoldCapacity, AttrCapacity, AttrCommandCenterHoldCapacity, AttrCorporateHangarCapacity, AttrDroneCapacity, AttrFuelBayCapacity, AttrGasHoldCapacity, AttrHasCorporateHangars, AttrIndustrialShipHoldCapacity, AttrLargeShipHoldCapacity, AttrMediumShipHoldCapacity, AttrMineralHoldCapacity, AttrOreHoldCapacity, AttrPlanetaryCommoditiesHoldCapacity, AttrQuafeHoldCapacity, AttrSalvageHoldCapacity, AttrSecondaryCapacity, AttrShipHoldCapacity, AttrShipMaintenanceBayCapacity, AttrSmallShipHoldCapacity, flagAmmoHold, flagCargoHold, flagCommandCenterHold, flagCorpHangar2, flagCorpHangar3, flagCorpHangar4, flagCorpHangar5, flagCorpHangar6, flagCorpHangar7, flagCorpMarket, flagDroneBay, flagFuelBay, flagGasHold, flagHangar, flagHiSlot0, flagImpounded, flagIndustrialShipHold, flagLargeShipHold, flagMediumShipHold, flagMineralHold, flagNone, flagOffice, flagOreHold, flagPlanetaryCommoditiesHold, flagProperty, flagQuafeBay, flagSalvageHold, flagSecondaryStorage, flagShipHangar, flagShipHold, flagSmallShipHold, m_myID, m_self, maxHangarCapy, and sDataMgr.
Referenced by Command_cargo(), CargoContainer::GetCapacity(), WreckContainer::GetCapacity(), GetRemainingCapacity(), and ValidateAddItem().
void Inventory::GetCargoList | ( | std::multimap< uint8, InventoryItemRef > & | cargoMap | ) |
Definition at line 332 of file Inventory.cpp.
References mContents.
Referenced by Command_cargo().
float Inventory::GetCorpHangerCapyUsed | ( | ) | const |
Definition at line 337 of file Inventory.cpp.
References AttrVolume, IsHangarFlag, and mContents.
Referenced by Command_cargo().
void Inventory::GetInventoryMap | ( | std::map< uint32, InventoryItemRef > & | invMap | ) |
Definition at line 453 of file Inventory.cpp.
References mContents.
Referenced by Command_inventory(), Command_shipinventory(), Command_skilllist(), Prospector::DropSalvage(), ShipItem::EmptyCargo(), ShipItem::GetModuleItemVec(), CustomsSE::Killed(), StructureSE::Killed(), ShipSE::Killed(), TradeService::TransferContainerContents(), and ShipItem::UpdateMass().
void Inventory::GetInventoryVec | ( | std::vector< InventoryItemRef > & | itemVec | ) |
Definition at line 345 of file Inventory.cpp.
References mContents, and SortVector().
Referenced by ModuleManager::Initialize().
void Inventory::GetInvForOwner | ( | uint32 | ownerID, |
std::vector< InventoryItemRef > & | items | ||
) |
Definition at line 425 of file Inventory.cpp.
References _log, IsOfficeID, m_myID, m_self, mContents, sDataMgr, and EvE::traceStack().
Referenced by StationItem::HasShip().
InventoryItemRef Inventory::GetItemByTypeFlag | ( | uint16 | typeID, |
EVEItemFlags | flag = flagNone |
||
) |
Definition at line 476 of file Inventory.cpp.
References GetItemsByFlag(), and items.
Definition at line 109 of file Inventory.cpp.
References InventoryDB::GetItemContents(), and m_db.
Referenced by LoadContents().
uint32 Inventory::GetItemsByFlag | ( | EVEItemFlags | flag, |
std::vector< InventoryItemRef > & | items | ||
) | const |
Definition at line 458 of file Inventory.cpp.
References m_contentsByFlag.
Referenced by Character::ClearSkillFlags(), ContainsTypeByFlag(), ContainsTypeQtyByFlag(), RamMethods::EncodeMissingMaterials(), RamMethods::GetBOMItems(), Character::GetCharInfo(), GetItemByTypeFlag(), Character::GetSkillsList(), Character::GetTotalSP(), Character::ProcessEffects(), Character::ResetModifiers(), and Character::VerifySP().
uint32 Inventory::GetItemsByFlagRange | ( | EVEItemFlags | low_flag, |
EVEItemFlags | high_flag, | ||
std::vector< InventoryItemRef > & | items | ||
) | const |
Definition at line 502 of file Inventory.cpp.
References mContents.
Referenced by ShipItem::GetShipInfo(), and ShipSE::MakeSlimItem().
uint32 Inventory::GetItemsByFlagSet | ( | std::set< EVEItemFlags > | flags, |
std::vector< InventoryItemRef > & | items | ||
) | const |
|
inline |
Definition at line 72 of file Inventory.h.
References GetCapacity(), and GetStoredVolume().
Referenced by ShipItem::GetRemainingVolumeByFlag(), HasAvailableSpace(), and ValidateAddItem().
bool Inventory::GetSingleItemByFlag | ( | EVEItemFlags | flag, |
InventoryItemRef & | iRef | ||
) | const |
Definition at line 489 of file Inventory.cpp.
References m_contentsByFlag.
Referenced by ShipItem::GetShipState().
float Inventory::GetStoredVolume | ( | EVEItemFlags | flag, |
bool | combined = true |
||
) | const |
Definition at line 609 of file Inventory.cpp.
References AttrVolume, IsHangarFlag, m_contentsByFlag, and mContents.
Referenced by Command_cargo(), GetRemainingCapacity(), and ValidateAddItem().
bool Inventory::GetTypesByFlag | ( | EVEItemFlags | flag, |
std::map< uint16, InventoryItemRef > & | items | ||
) |
Definition at line 465 of file Inventory.cpp.
References m_contentsByFlag.
Referenced by RamMethods::GetBOMItemsMap().
bool Inventory::HasAvailableSpace | ( | EVEItemFlags | flag, |
InventoryItemRef | iRef | ||
) | const |
Definition at line 625 of file Inventory.cpp.
References _log, AttrVolume, GetRemainingCapacity(), is_log_enabled, m_self, and sDataMgr.
Referenced by MiningLaser::ProcessCycle(), ModuleManager::UnloadCharge(), and StationOffice::ValidateAddItem().
|
inline |
Definition at line 55 of file Inventory.h.
References mContents.
Referenced by Prospector::DropSalvage(), CargoContainer::IsEmpty(), WreckContainer::IsEmpty(), CargoContainer::RemoveItem(), and WreckContainer::RemoveItem().
bool Inventory::IsEmptyByFlag | ( | EVEItemFlags | flag | ) | const |
Definition at line 498 of file Inventory.cpp.
References m_contentsByFlag.
CRowSet * Inventory::List | ( | EVEItemFlags | flag, |
uint32 | ownerID = 0 |
||
) | const |
Definition at line 290 of file Inventory.cpp.
References PyRep::Dump(), is_log_enabled, and sDataMgr.
|
protected |
Definition at line 301 of file Inventory.cpp.
References EVEDB::invCategories::Charge, flagNone, IsCharacterID, IsFittingSlot, IsOfficeID, m_myID, m_self, mContents, CRowSet::NewRow(), sDataMgr, and EVEDB::invCategories::Ship.
bool Inventory::LoadContents | ( | ) |
Definition at line 113 of file Inventory.cpp.
References _log, AddItem(), Client::AddStationHangar(), OwnerData::corpID, RefPtr< X >::get(), GetItems(), GetTimeUSeconds(), IsAgent, IsOfficeID, IsPlayerCorp, Profile::itemload, items, itoa(), StationDB::LoadOffices(), OwnerData::locID, m_myID, m_self, mContentsLoaded, OwnerData::ownerID, sConfig, sDataMgr, sItemFactory, sProfiler, and RefPtr< StationItem >::StaticCast().
Referenced by StructureItem::_Load(), CargoContainer::_Load(), StationItem::_Load(), ShipItem::_Load(), WreckContainer::_Load(), Character::_Load(), DynamicEntityFactory::BuildEntity(), CargoContainer::CargoContainerGetInfo(), CargoContainer::Delete(), WreckContainer::Delete(), ShipItem::GetChargeState(), Character::GetCharInfo(), ShipItem::GetShipInfo(), ShipItem::GetShipState(), Client::LoadStationHangar(), Reset(), ShipItem::ShipGetModuleList(), StationOffice::StationOfficeGetInfo(), StructureItem::StructureGetInfo(), and WreckContainer::WreckContainerGetInfo().
void Inventory::RemoveItem | ( | InventoryItemRef | iRef | ) |
Definition at line 243 of file Inventory.cpp.
References _log, RefPtr< X >::get(), m_contentsByFlag, m_myID, m_self, mContents, and sDataMgr.
Referenced by ProbeItem::Delete(), InventoryItem::Delete(), ShipItem::LogOut(), InventoryItem::RemoveItem(), ShipItem::SetPlayer(), and InventoryItem::ToVirtual().
void Inventory::Reset | ( | ) |
Definition at line 56 of file Inventory.cpp.
References LoadContents(), and Unload().
|
private |
Definition at line 356 of file Inventory.cpp.
References _log, GetTimeUSeconds(), IsCargoHoldFlag, IsModuleSlot, and sConfig.
Referenced by GetInventoryVec().
void Inventory::StackAll | ( | EVEItemFlags | flag, |
uint32 | ownerID = 0 |
||
) |
Definition at line 575 of file Inventory.cpp.
References IsModuleSlot, and m_contentsByFlag.
void Inventory::Unload | ( | ) |
Definition at line 62 of file Inventory.cpp.
References Inv::SaveData::contraband, Inv::SaveData::customInfo, Inv::SaveData::flag, flagSkill, IsPlayerItem, Inv::SaveData::itemID, items, Inv::SaveData::locationID, m_contentsByFlag, mContents, mContentsLoaded, Inv::SaveData::ownerID, Inv::SaveData::position, Inv::SaveData::quantity, ItemDB::SaveItems(), sConsole, Inv::SaveData::singleton, sItemFactory, Inv::SaveData::typeID, and Unload().
Referenced by ShipItem::LogOut(), Character::LogOut(), Reset(), Unload(), StationSE::UnloadStation(), SystemManager::UnloadSystem(), CargoContainer::~CargoContainer(), SolarSystem::~SolarSystem(), StationItem::~StationItem(), StationOffice::~StationOffice(), and WreckContainer::~WreckContainer().
bool Inventory::ValidateAddItem | ( | EVEItemFlags | flag, |
InventoryItemRef | iRef | ||
) | const |
modify checks for splitting items in same container or moving items between a container's corp hangars flag and iRef->flag() will be same (or same type). add requested move volume to container's available capy before other checks this will show item being removed from container to allow subsequent additions
Definition at line 747 of file Inventory.cpp.
References _log, UserError::AddAmount(), UserError::AddFormatValue(), UserError::AddLocationName(), args, AttrMaxOperationalDistance, AttrVolume, EVEDB::invGroups::Cargo_Container, flagDroneBay, flagShipHangar, GetCapacity(), GetRemainingCapacity(), GetStoredVolume(), EVEDB::invTypes::InfrastructureHub, IsCargoHoldFlag, IsHangarFlag, IsModuleSlot, IsSpecialHoldFlag, m_self, sDataMgr, sItemFactory, EVEDB::invCategories::Station, EVEDB::invCategories::StructureUpgrade, and ValidateIHubUpgrade().
Referenced by InventoryBound::MoveItems(), and CargoContainer::ValidateAddItem().
bool Inventory::ValidateIHubUpgrade | ( | InventoryItemRef | iRef | ) | const |
Definition at line 706 of file Inventory.cpp.
References _log, SovereigntyData::claimTime, GetFileTimeNow(), m_self, sItemFactory, svDataMgr, EVEDB::invTypes::UpgAdvancedLogisticsNetwork, EVEDB::invTypes::UpgCynosuralNavigation, EVEDB::invTypes::UpgCynosuralSuppression, and Win32Time_Day.
Referenced by ValidateAddItem().
|
friend |
Definition at line 39 of file Inventory.h.
|
private |
Definition at line 115 of file Inventory.h.
Referenced by AddItem(), DeleteContents(), GetByTypeFlag(), GetItemsByFlag(), GetSingleItemByFlag(), GetStoredVolume(), GetTypesByFlag(), IsEmptyByFlag(), RemoveItem(), StackAll(), and Unload().
|
protected |
Definition at line 103 of file Inventory.h.
Referenced by GetItems().
|
private |
Definition at line 111 of file Inventory.h.
|
private |
Definition at line 109 of file Inventory.h.
Referenced by AddItem(), GetCapacity(), GetInvForOwner(), Inventory(), List(), LoadContents(), and RemoveItem().
|
protected |
Definition at line 104 of file Inventory.h.
Referenced by AddItem(), GetCapacity(), GetInvForOwner(), HasAvailableSpace(), Inventory(), List(), LoadContents(), RemoveItem(), ValidateAddItem(), and ValidateIHubUpgrade().
|
private |
Definition at line 114 of file Inventory.h.
Referenced by AddItem(), ContainsItem(), ContainsTypeQty(), DeleteContents(), FindFirstByFlag(), GetByID(), GetCargoList(), GetCorpHangerCapyUsed(), GetInventoryMap(), GetInventoryVec(), GetInvForOwner(), GetItemsByFlagRange(), GetItemsByFlagSet(), GetStoredVolume(), IsEmpty(), List(), RemoveItem(), and Unload().
|
private |
Definition at line 107 of file Inventory.h.
Referenced by ContentsLoaded(), DeleteContents(), Inventory(), LoadContents(), and Unload().