EvEmu
0.8.4
11 September 2021
|
#include "AttributeMap.h"
Public Member Functions | |
AttributeMap (InventoryItem &item) | |
~AttributeMap () noexcept | |
void | SetAttribute (uint16 attrID, EvilNumber &num, bool notify=true) |
void | MultiplyAttribute (uint16 attrID, EvilNumber &num, bool notify=false) |
EvilNumber | GetAttribute (const uint16 attrID) const |
bool | HasAttribute (const uint16 attrID) const |
bool | HasAttribute (const uint16 attrID, EvilNumber &value) const |
bool | Save () |
void | Delete () |
void | DeleteAttribute (uint16 attrID) |
bool | Load (bool reset=false) |
void | SaveShipState () |
bool | SaveAttributes () |
void | ResetAttribute (uint16 attrID, bool notify=false) |
void | CopyAttributes (std::map< uint16, EvilNumber > &attrMap) |
AttrMapItr | begin () |
return the begin iterator of the AttributeMap More... | |
AttrMapItr | end () |
return the end iterator of the AttributeMap More... | |
Protected Member Functions | |
bool | Change (uint16 attrID, EvilNumber &old_val, EvilNumber &new_val) |
internal function to handle the change. More... | |
bool | Add (uint16 attrID, EvilNumber &num) |
internal function to handle adding attributes. More... | |
bool | SendChanges (PyTuple *attrChange) |
queue the attribute changes into the QueueDestinyEvent system. More... | |
Protected Attributes | |
InventoryItem & | mItem |
AttrMap | mAttributes |
Private Attributes | |
InventoryDB | m_db |
Definition at line 41 of file AttributeMap.h.
AttributeMap::AttributeMap | ( | InventoryItem & | item | ) |
|
noexcept |
Definition at line 54 of file AttributeMap.cpp.
|
protected |
internal function to handle adding attributes.
[in] | attributeId | the attribute id that needs to be added. |
[in] | num | the number the attribute needs to be set to. |
true | The attribute has successfully been added and queued. |
false | The attribute addition has not been queued and not been changed. |
Definition at line 393 of file AttributeMap.cpp.
References AttrStartTime, InventoryItem::categoryID(), EVEDB::invCategories::Charge, InventoryItem::flag(), GetFileTimeNow(), EvilNumber::GetPyObject(), IsCharacterID, IsFittingSlot, InventoryItem::itemID(), InventoryItem::locationID(), mItem, InventoryItem::ownerID(), PyStatic, SendChanges(), PyTuple::SetItem(), and InventoryItem::typeID().
Referenced by SetAttribute().
AttrMapItr AttributeMap::begin | ( | ) |
return the begin iterator of the AttributeMap
Definition at line 598 of file AttributeMap.cpp.
References mAttributes.
Referenced by InventoryItem::Populate().
|
protected |
internal function to handle the change.
[in] | attributeId | the attribute id that needs to be changed. |
[in] | num | the number the attribute needs to be changed in. |
true | The attribute change has successfully been set and queued. |
false | The attribute change has not been queued but has been changed. |
Definition at line 337 of file AttributeMap.cpp.
References AttrStartTime, InventoryItem::categoryID(), EVEDB::invCategories::Charge, InventoryItem::flag(), GetFileTimeNow(), EvilNumber::GetPyObject(), IsCharacterID, IsFittingSlot, InventoryItem::itemID(), InventoryItem::locationID(), mItem, InventoryItem::ownerID(), SendChanges(), PyTuple::SetItem(), and InventoryItem::typeID().
Referenced by MultiplyAttribute(), and SetAttribute().
void AttributeMap::CopyAttributes | ( | std::map< uint16, EvilNumber > & | attrMap | ) |
Definition at line 480 of file AttributeMap.cpp.
References mAttributes.
Referenced by Command_attrlist().
void AttributeMap::Delete | ( | ) |
Definition at line 573 of file AttributeMap.cpp.
References mAttributes.
Referenced by InventoryItem::ToVirtual().
void AttributeMap::DeleteAttribute | ( | uint16 | attrID | ) |
Definition at line 577 of file AttributeMap.cpp.
References _log, DBerror::c_str(), IsCharacterID, InventoryItem::itemID(), mAttributes, mItem, InventoryItem::name(), and sDatabase.
Referenced by InventoryItem::DeleteAttribute().
AttrMapItr AttributeMap::end | ( | ) |
return the end iterator of the AttributeMap
Definition at line 602 of file AttributeMap.cpp.
References mAttributes.
Referenced by InventoryItem::Populate(), and Save().
EvilNumber AttributeMap::GetAttribute | ( | const uint16 | attrID | ) | const |
Definition at line 309 of file AttributeMap.cpp.
References EvilZero, and mAttributes.
Referenced by InventoryItem::GetAttribute(), and InventoryItem::Populate().
bool AttributeMap::HasAttribute | ( | const uint16 | attrID | ) | const |
Definition at line 317 of file AttributeMap.cpp.
References mAttributes.
Referenced by InventoryItem::HasAttribute().
bool AttributeMap::HasAttribute | ( | const uint16 | attrID, |
EvilNumber & | value | ||
) | const |
bool AttributeMap::Load | ( | bool | reset = false | ) |
Definition at line 60 of file AttributeMap.cpp.
References _log, DBerror::c_str(), ItemType::CopyAttributes(), DBQueryResult::error, EvilZero, DBResultRow::GetDouble(), DBResultRow::GetInt64(), DBQueryResult::GetRow(), DBResultRow::GetUInt(), is_log_enabled, IsCharacterID, IsNPC, DBResultRow::IsNull(), IsTempItem, InventoryItem::itemID(), mAttributes, mItem, InventoryItem::name(), sDatabase, SetAttribute(), and InventoryItem::type().
Referenced by InventoryItem::_Load(), and InventoryItem::ResetAttributes().
void AttributeMap::MultiplyAttribute | ( | uint16 | attrID, |
EvilNumber & | num, | ||
bool | notify = false |
||
) |
Definition at line 280 of file AttributeMap.cpp.
References _log, Change(), EvilZero, EvilNumber::isInf(), EvilNumber::isNaN(), InventoryItem::itemID(), mAttributes, mItem, InventoryItem::name(), and EvE::traceStack().
Referenced by InventoryItem::MultiplyAttribute().
void AttributeMap::ResetAttribute | ( | uint16 | attrID, |
bool | notify = false |
||
) |
Definition at line 475 of file AttributeMap.cpp.
References InventoryItem::GetDefaultAttribute(), mItem, and SetAttribute().
Referenced by InventoryItem::ResetAttribute().
bool AttributeMap::Save | ( | ) |
ship damage saved separately
Definition at line 106 of file AttributeMap.cpp.
References EVEDB::invCategories::Asteroid, AttrCharisma, AttrCharismaBonus, AttrCustomCharismaBonus, AttrCustomIntelligenceBonus, AttrCustomMemoryBonus, AttrCustomPerceptionBonus, AttrCustomWillpowerBonus, AttrDamage, Inv::AttrData::attrID, AttrIntelligence, AttrIntelligenceBonus, AttrMemory, AttrMemoryBonus, AttrOnline, AttrPerception, AttrPerceptionBonus, AttrSkillLevel, AttrSkillPoints, AttrWillpower, AttrWillpowerBonus, EVEDB::invCategories::Blueprint, InventoryItem::categoryID(), EVEDB::invCategories::Celestial, EVEDB::invCategories::Charge, Profile::damage, EVEDB::invCategories::Deployable, EVEDB::invCategories::Drone, end(), EvilZero, IsCharacterID, IsStaticItem, InventoryItem::itemID(), Inv::AttrData::itemID, mAttributes, mItem, EVEDB::invCategories::Module, EVEDB::invCategories::Orbitals, ItemDB::SaveAttributes(), EVEDB::invCategories::Ship, EVEDB::invCategories::Skill, EVEDB::invCategories::SovereigntyStructure, EVEDB::invCategories::Structure, EVEDB::invCategories::StructureUpgrade, EVEDB::invCategories::Subsystem, Inv::AttrData::type, Inv::AttrData::valueFloat, and Inv::AttrData::valueInt.
Referenced by SaveAttributes(), and InventoryItem::SaveItem().
bool AttributeMap::SaveAttributes | ( | ) |
Definition at line 102 of file AttributeMap.cpp.
References Save().
Referenced by InventoryItem::SaveAttributes().
void AttributeMap::SaveShipState | ( | ) |
Definition at line 486 of file AttributeMap.cpp.
References _log, AttrArmorDamage, AttrDamage, AttrHeatHi, AttrHeatLow, AttrHeatMed, AttrShieldCharge, DBerror::c_str(), evil_number_int, InventoryItem::itemID(), mAttributes, mItem, and sDatabase.
Referenced by ShipItem::ProcessEffects(), ShipItem::ResetEffects(), and ShipItem::SaveShip().
|
protected |
queue the attribute changes into the QueueDestinyEvent system.
[in] | attrChange | the attribute id that needs to be added. |
true | The attribute has successfully been added and queued. |
false | The attribute addition has not been queued and not been changed. |
Definition at line 428 of file AttributeMap.cpp.
References _log, MulticastTarget::corporations, PyRep::Dump(), is_log_enabled, IsCharacterID, IsCorp, Client::IsLogin(), IsPlayerCorp, InventoryItem::itemID(), InventoryItem::locationID(), MulticastTarget::locations, mItem, InventoryItem::name(), InventoryItem::ownerID(), Client::QueueDestinyEvent(), sDataMgr, and sEntityList.
Referenced by Add(), and Change().
void AttributeMap::SetAttribute | ( | uint16 | attrID, |
EvilNumber & | num, | ||
bool | notify = true |
||
) |
Definition at line 217 of file AttributeMap.cpp.
References _log, Add(), Change(), EvilNumber::get_float(), EvilNumber::get_int(), is_log_enabled, EvilNumber::isFloat(), EvilNumber::isInf(), EvilNumber::isNaN(), InventoryItem::itemID(), mAttributes, mItem, InventoryItem::name(), and EvE::traceStack().
Referenced by Load(), ResetAttribute(), and InventoryItem::SetAttribute().
|
private |
Definition at line 122 of file AttributeMap.h.
|
protected |
Definition at line 119 of file AttributeMap.h.
Referenced by AttributeMap(), begin(), CopyAttributes(), Delete(), DeleteAttribute(), end(), GetAttribute(), HasAttribute(), Load(), MultiplyAttribute(), Save(), SaveShipState(), and SetAttribute().
|
protected |
Definition at line 117 of file AttributeMap.h.
Referenced by Add(), Change(), DeleteAttribute(), Load(), MultiplyAttribute(), ResetAttribute(), Save(), SaveShipState(), SendChanges(), and SetAttribute().