EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SolarSystem Class Reference

#include "SolarSystem.h"

Inheritance diagram for SolarSystem:
Collaboration diagram for SolarSystem:

Public Member Functions

const GPointminPosition () const
 
const GPointmaxPosition () const
 
double luminosity () const
 
bool border () const
 
bool fringe () const
 
bool corridor () const
 
bool hub () const
 
bool international () const
 
bool regional () const
 
bool constellation () const
 
double security () const
 
uint32 factionID () const
 
double radius () const
 
const std::string & securityClass () const
 
void AddItemToInventory (InventoryItemRef iRef)
 
void RemoveItemFromInventory (InventoryItemRef iRef)
 
- Public Member Functions inherited from CelestialObject
 CelestialObject (uint32 _celestialID, const ItemType &_type, const ItemData &_data)
 
 CelestialObject (uint32 _celestialID, const ItemType &_type, const ItemData &_data, const CelestialObjectData &_cData)
 
virtual ~CelestialObject ()
 
void Delete ()
 
double radius () const
 
double security () const
 
uint8 celestialIndex () const
 
uint8 orbitIndex () const
 
- Public Member Functions inherited from InventoryItem
 InventoryItem (uint32 _itemID, const ItemType &_type, const ItemData &_data)
 
 InventoryItem (const InventoryItem &oth)
 
 InventoryItem (InventoryItem &&oth) noexcept
 
InventoryItemoperator= (const InventoryItem &oth)=delete
 
InventoryItemoperator= (InventoryItem &&oth)=delete
 
virtual ~InventoryItem () noexcept
 
virtual ShipItemGetShipItem ()
 
virtual ModuleItemGetModuleItem ()
 
virtual bool IsShipItem ()
 
virtual bool IsModuleItem ()
 
virtual void Rename (std::string name)
 
InventoryGetMyInventory ()
 
bool contraband () const
 
bool isSingleton () const
 
int32 quantity () const
 
uint32 itemID () const
 
uint32 ownerID () const
 
uint32 locationID () const
 
EVEItemFlags flag () const
 
const GPointposition () const
 
const ItemTypetype () const
 
const std::string & itemName () const
 
const std::string & customInfo () const
 
const char * name ()
 
uint16 typeID () const
 
uint16 groupID () const
 
double radius () const
 
uint8 categoryID () const
 
bool isGlobal () const
 
bool IsOnline ()
 
void SetPosition (const GPoint &pos)
 
void SetCustomInfo (const char *ci)
 
void ChangeOwner (uint32 new_owner, bool notify=false)
 
void Move (uint32 new_location=locTemp, EVEItemFlags flag=flagNone, bool notify=false)
 
void Donate (uint32 new_owner=ownerSystem, uint32 new_location=locTemp, EVEItemFlags new_flag=flagNone, bool notify=true)
 
void SendItemChange (uint32 toID, std::map< int32, PyRep * > &changes)
 
void MergeTypesInCargo (ShipItem *pShip, EVEItemFlags flag=flagNone)
 
bool ChangeSingleton (bool singleton, bool notify=false)
 
bool AlterQuantity (int32 qty, bool notify=false)
 
bool SetQuantity (int32 qty, bool notify=false, bool deleteOnZero=true)
 
bool SetFlag (EVEItemFlags flag, bool notify=false)
 
void SetOwner (uint32 ownerID)
 
void SaveItem ()
 
void UpdateLocation ()
 
void UpdateLocation (uint32 locID)
 
virtual InventoryItemRef Split (int32 qty=0, bool notify=true, bool silent=false)
 
virtual bool Merge (InventoryItemRef to_merge, int32 qty=0, bool notify=true)
 
virtual void Relocate (uint32 locID=0, EVEItemFlags flag=flagNone)
 
virtual void AddItem (InventoryItemRef iRef)
 
virtual void RemoveItem (InventoryItemRef iRef)
 
double GetPackagedVolume ()
 
virtual void SetPlayer (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 
void ToVirtual (uint32 locationID)
 
PyRepGetItem () const
 
void GetItemRow (PyPackedRow *into) const
 
void GetItemStatusRow (PyPackedRow *into) const
 
void GetChargeStatusRow (uint32 shipID, PyPackedRow *into) const
 
bool Populate (Rsp_CommonGetInfo_Entry &into)
 
PyListGetItemInfo () const
 
PyObjectItemGetInfo ()
 
PyPackedRowGetItemRow () const
 
PyPackedRowGetItemStatusRow () const
 
PyPackedRowGetChargeStatusRow (uint32 shipID) const
 
bool SkillCheck (InventoryItemRef refItem)
 
void ClearModifiers ()
 
void AddModifier (fxData &data)
 
void RemoveModifier (fxData &data)
 
void ResetAttributes ()
 
bool HasReqSkill (const uint16 skillID)
 
AttributeMapGetAttributeMap ()
 
int64 GetTimeStamp ()
 
void SetAttribute (uint16 attrID, int num, bool notify=true)
 
void SetAttribute (uint16 attrID, uint32 num, bool notify=true)
 
void SetAttribute (uint16 attrID, int64 num, bool notify=true)
 
void SetAttribute (uint16 attrID, float num, bool notify=true)
 
void SetAttribute (uint16 attrID, double num, bool notify=true)
 
void SetAttribute (uint16 attrID, EvilNumber num, bool notify=true)
 
void MultiplyAttribute (uint16 attrID, EvilNumber num, bool notify=false)
 
bool HasAttribute (const uint16 attrID) const
 
bool HasAttribute (const uint16 attrID, EvilNumber &value) const
 
bool SaveAttributes ()
 
void ResetAttribute (uint16 attrID, bool notify=false)
 
void DeleteAttribute (uint16 attrID)
 
EvilNumber GetAttribute (const uint16 attrID) const
 
EvilNumber GetDefaultAttribute (const uint16 attrID) const
 
- Public Member Functions inherited from RefObject
 RefObject (size_t initRefCount)
 Initializes reference count. More...
 
virtual ~RefObject ()
 Destructor; must be virtual. More...
 
size_t GetCount ()
 

Static Public Member Functions

static SolarSystemRef Load (uint32 solarSystemID)
 
- Static Public Member Functions inherited from CelestialObject
static CelestialObjectRef Load (uint32 celestialID)
 
static CelestialObjectRef Spawn (ItemData &data)
 
- Static Public Member Functions inherited from InventoryItem
static uint32 CreateItemID (ItemData &data)
 
static uint32 CreateTempItemID (ItemData &data)
 
static InventoryItemRef Load (uint32 itemID)
 
static InventoryItemRef SpawnItem (uint32 itemID, const ItemData &data)
 
static InventoryItemRef Spawn (ItemData &data)
 
static InventoryItemRef SpawnTemp (ItemData &data)
 

Protected Member Functions

 SolarSystem (uint32 _solarSystemID, const ItemType &_type, const ItemData &_data, const CelestialObjectData &_cData, const SolarSystemData &_ssData)
 
virtual ~SolarSystem ()
 
virtual bool _Load ()
 
- Protected Member Functions inherited from RefObject
void IncRef () const
 Increments reference count of object by one. More...
 
void DecRef () const
 Decrements reference count of object by one. More...
 

Static Protected Member Functions

template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 solarSystemID, const ItemType &type, const ItemData &data)
 
- Static Protected Member Functions inherited from CelestialObject
template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 celestialID, const ItemType &type, const ItemData &data)
 
static uint32 CreateItemID (ItemData &data)
 
- Static Protected Member Functions inherited from InventoryItem
template<class _Ty >
static RefPtr< _Ty > Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _Load (uint32 itemID)
 
template<class _Ty >
static RefPtr< _Ty > _LoadItem (uint32 itemID, const ItemType &type, const ItemData &data)
 

Protected Attributes

bool m_border:1
 
bool m_fringe:1
 
bool m_corridor:1
 
bool m_hub:1
 
bool m_international:1
 
bool m_regional:1
 
bool m_constellation:1
 
uint32 m_factionID
 
double m_security
 
double m_radius
 
double m_luminosity
 
std::string m_securityClass
 
GPoint m_minPosition
 
GPoint m_maxPosition
 
- Protected Attributes inherited from CelestialObject
double m_radius
 
double m_security
 
uint8 m_celestialIndex
 
uint8 m_orbitIndex
 
- Protected Attributes inherited from InventoryItem
InventorypInventory
 
uint32 m_itemID
 
AttributeMappAttributeMap
 
- Protected Attributes inherited from RefObject
size_t mRefCount
 Reference count of instance. More...
 
bool mDeleted
 

Friends

class InventoryItem
 
class CelestialObject
 

Additional Inherited Members

- Public Attributes inherited from InventoryItem
std::multimap< int8, fxDatam_modifiers
 

Detailed Description

CelestialObject which represents solar system.

Definition at line 80 of file SolarSystem.h.

Constructor & Destructor Documentation

SolarSystem::SolarSystem ( uint32  _solarSystemID,
const ItemType _type,
const ItemData _data,
const CelestialObjectData _cData,
const SolarSystemData _ssData 
)
protected

Definition at line 86 of file SolarSystem.cpp.

References _log, InventoryItem::m_itemID, InventoryItem::name(), and InventoryItem::pInventory.

Referenced by _LoadItem().

92 : CelestialObject(_solarSystemID, _type, _data, _cData),
93  m_minPosition(_ssData.minPosition),
94  m_maxPosition(_ssData.maxPosition),
95  m_luminosity(_ssData.luminosity),
96  m_border(_ssData.border),
97  m_fringe(_ssData.fringe),
98  m_corridor(_ssData.corridor),
99  m_hub(_ssData.hub),
101  m_regional(_ssData.regional),
103  m_security(_ssData.security),
104  m_factionID(_ssData.factionID),
105  m_radius(_ssData.radius),
107 {
109 
110  _log(ITEM__TRACE, "Created SolarSystem Item %p for %s (%u).", this, name(), m_itemID);
111 }
#define _log(type, fmt,...)
Definition: logsys.h:124
double luminosity
Definition: SolarSystem.h:59
GPoint m_minPosition
Definition: SolarSystem.h:180
GPoint maxPosition
Definition: SolarSystem.h:58
GPoint minPosition
Definition: SolarSystem.h:57
const char * name()
bool m_corridor
Definition: SolarSystem.h:167
double m_radius
Definition: SolarSystem.h:176
Inventory * pInventory
bool m_regional
Definition: SolarSystem.h:170
double m_security
Definition: SolarSystem.h:175
uint32 factionID
Definition: SolarSystem.h:71
GPoint m_maxPosition
Definition: SolarSystem.h:181
RefPtr< InventoryItem > InventoryItemRef
Definition: ItemRef.h:52
double m_luminosity
Definition: SolarSystem.h:177
std::string m_securityClass
Definition: SolarSystem.h:179
std::string securityClass
Definition: SolarSystem.h:74
friend class CelestialObject
Definition: SolarSystem.h:84
uint32 m_factionID
Definition: SolarSystem.h:173
bool m_international
Definition: SolarSystem.h:169
bool m_constellation
Definition: SolarSystem.h:171

Here is the call graph for this function:

Here is the caller graph for this function:

SolarSystem::~SolarSystem ( )
protectedvirtual

Definition at line 113 of file SolarSystem.cpp.

References InventoryItem::pInventory, SafeDelete(), and Inventory::Unload().

113  {
114  if (pInventory != nullptr)
115  pInventory->Unload();
117 }
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
void Unload()
Definition: Inventory.cpp:62
Inventory * pInventory

Here is the call graph for this function:

Member Function Documentation

bool SolarSystem::_Load ( )
protectedvirtual

Reimplemented from InventoryItem.

Definition at line 124 of file SolarSystem.cpp.

References InventoryItem::_Load().

125 {
126  return CelestialObject::_Load();
127 }
virtual bool _Load()

Here is the call graph for this function:

template<class _Ty >
static RefPtr<_Ty> SolarSystem::_LoadItem ( uint32  solarSystemID,
const ItemType type,
const ItemData data 
)
inlinestaticprotected
Todo:
is this data in static data? if not, do we continue db hit?

Definition at line 140 of file SolarSystem.h.

References _log, ItemType::categoryID(), ItemType::groupID(), sConfig, sDataMgr, sItemFactory, EVEDB::invGroups::Solar_System, SolarSystem(), and EvE::traceStack().

140  {
141  if (type.groupID() != EVEDB::invGroups::Solar_System) {
142  _log(ITEM__ERROR, "Trying to load %s as SolarSystem.", sDataMgr.GetCategoryName(type.categoryID()));
143  if (sConfig.debug.StackTrace)
144  EvE::traceStack();
145  return RefPtr<_Ty>();
146  }
147 
148  // load celestial data
150  if (!sItemFactory.db()->GetCelestialObject(solarSystemID, cData))
151  return RefPtr<_Ty>();
152 
153  // load solar system data
155  SolarSystemData ssData = SolarSystemData();
156  if( !sItemFactory.db()->GetSolarSystem( solarSystemID, ssData ) )
157  return RefPtr<_Ty>();
158 
159  return SolarSystemRef( new SolarSystem(solarSystemID, type, data, cData, ssData ) );
160  }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
uint16 groupID() const
Definition: ItemType.h:64
RefPtr< SolarSystem > SolarSystemRef
Definition: ItemRef.h:65
uint8 categoryID() const
Definition: ItemType.h:66
SolarSystem(uint32 _solarSystemID, const ItemType &_type, const ItemData &_data, const CelestialObjectData &_cData, const SolarSystemData &_ssData)
Definition: SolarSystem.cpp:86
void traceStack(void)
Definition: misc.cpp:169
#define sItemFactory
Definition: ItemFactory.h:165
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr

Here is the call graph for this function:

void SolarSystem::AddItemToInventory ( InventoryItemRef  iRef)

Definition at line 129 of file SolarSystem.cpp.

References _log, InventoryItem::AddItem(), InventoryItem::itemID(), InventoryItem::m_itemID, and InventoryItem::name().

Referenced by SystemManager::AddEntity(), and SystemManager::AddItemToInventory().

130 {
131  _log(ITEM__TRACE, "SS::AddItemToInventory() - adding %s(%u) to inventory of %s(%u)",\
132  iRef->name(), iRef->itemID(), name(), m_itemID);
133  AddItem( iRef );
134 }
#define _log(type, fmt,...)
Definition: logsys.h:124
virtual void AddItem(InventoryItemRef iRef)
const char * name()
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

bool SolarSystem::border ( ) const
inline

Definition at line 102 of file SolarSystem.h.

References m_border.

102 { return m_border; }
bool SolarSystem::constellation ( ) const
inline

Definition at line 108 of file SolarSystem.h.

References m_constellation.

108 { return m_constellation; }
bool m_constellation
Definition: SolarSystem.h:171
bool SolarSystem::corridor ( ) const
inline

Definition at line 104 of file SolarSystem.h.

References m_corridor.

104 { return m_corridor; }
bool m_corridor
Definition: SolarSystem.h:167
uint32 SolarSystem::factionID ( ) const
inline

Definition at line 111 of file SolarSystem.h.

References m_factionID.

111 { return m_factionID; }
uint32 m_factionID
Definition: SolarSystem.h:173
bool SolarSystem::fringe ( ) const
inline

Definition at line 103 of file SolarSystem.h.

References m_fringe.

103 { return m_fringe; }
bool SolarSystem::hub ( ) const
inline

Definition at line 105 of file SolarSystem.h.

References m_hub.

105 { return m_hub; }
bool SolarSystem::international ( ) const
inline

Definition at line 106 of file SolarSystem.h.

References m_international.

106 { return m_international; }
bool m_international
Definition: SolarSystem.h:169
SolarSystemRef SolarSystem::Load ( uint32  solarSystemID)
static

Loads solar system from DB.

Parameters
[in]factory
[in]solarSystemIDID of solar system to load.
Returns
Pointer to new solar system object; NULL if failed.

Definition at line 119 of file SolarSystem.cpp.

120 {
121  return InventoryItem::Load<SolarSystem>(solarSystemID);
122 }
double SolarSystem::luminosity ( ) const
inline

Definition at line 100 of file SolarSystem.h.

References m_luminosity.

100 { return m_luminosity; }
double m_luminosity
Definition: SolarSystem.h:177
const GPoint& SolarSystem::maxPosition ( ) const
inline

Definition at line 99 of file SolarSystem.h.

References m_maxPosition.

99 { return m_maxPosition; }
GPoint m_maxPosition
Definition: SolarSystem.h:181
const GPoint& SolarSystem::minPosition ( ) const
inline

Definition at line 98 of file SolarSystem.h.

References m_minPosition.

98 { return m_minPosition; }
GPoint m_minPosition
Definition: SolarSystem.h:180
double SolarSystem::radius ( ) const
inline

Definition at line 112 of file SolarSystem.h.

References m_radius.

112 { return m_radius; }
double m_radius
Definition: SolarSystem.h:176
bool SolarSystem::regional ( ) const
inline

Definition at line 107 of file SolarSystem.h.

References m_regional.

107 { return m_regional; }
bool m_regional
Definition: SolarSystem.h:170
void SolarSystem::RemoveItemFromInventory ( InventoryItemRef  iRef)

Definition at line 136 of file SolarSystem.cpp.

References _log, InventoryItem::itemID(), InventoryItem::m_itemID, InventoryItem::name(), and InventoryItem::RemoveItem().

Referenced by SystemManager::RemoveItemFromInventory().

137 {
138  _log(ITEM__TRACE, "SS::RemoveItemFromInventory() - removing item %s(%u) from inventory of %s(%u)",\
139  iRef->name(), iRef->itemID(), name(), m_itemID);
140  RemoveItem( iRef );
141 }
#define _log(type, fmt,...)
Definition: logsys.h:124
virtual void RemoveItem(InventoryItemRef iRef)
const char * name()
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

double SolarSystem::security ( ) const
inline

Definition at line 110 of file SolarSystem.h.

References m_security.

110 { return m_security; }
double m_security
Definition: SolarSystem.h:175
const std::string& SolarSystem::securityClass ( ) const
inline

Definition at line 113 of file SolarSystem.h.

References m_securityClass.

113 { return m_securityClass; }
std::string m_securityClass
Definition: SolarSystem.h:179

Friends And Related Function Documentation

friend class CelestialObject
friend

Definition at line 84 of file SolarSystem.h.

friend class InventoryItem
friend

Definition at line 83 of file SolarSystem.h.

Member Data Documentation

bool SolarSystem::m_border
protected

Definition at line 165 of file SolarSystem.h.

Referenced by border().

bool SolarSystem::m_constellation
protected

Definition at line 171 of file SolarSystem.h.

Referenced by constellation().

bool SolarSystem::m_corridor
protected

Definition at line 167 of file SolarSystem.h.

Referenced by corridor().

uint32 SolarSystem::m_factionID
protected

Definition at line 173 of file SolarSystem.h.

Referenced by factionID().

bool SolarSystem::m_fringe
protected

Definition at line 166 of file SolarSystem.h.

Referenced by fringe().

bool SolarSystem::m_hub
protected

Definition at line 168 of file SolarSystem.h.

Referenced by hub().

bool SolarSystem::m_international
protected

Definition at line 169 of file SolarSystem.h.

Referenced by international().

double SolarSystem::m_luminosity
protected

Definition at line 177 of file SolarSystem.h.

Referenced by luminosity().

GPoint SolarSystem::m_maxPosition
protected

Definition at line 181 of file SolarSystem.h.

Referenced by maxPosition().

GPoint SolarSystem::m_minPosition
protected

Definition at line 180 of file SolarSystem.h.

Referenced by minPosition().

double SolarSystem::m_radius
protected

Definition at line 176 of file SolarSystem.h.

Referenced by radius().

bool SolarSystem::m_regional
protected

Definition at line 170 of file SolarSystem.h.

Referenced by regional().

double SolarSystem::m_security
protected

Definition at line 175 of file SolarSystem.h.

Referenced by security().

std::string SolarSystem::m_securityClass
protected

Definition at line 179 of file SolarSystem.h.

Referenced by securityClass().


The documentation for this class was generated from the following files: