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

#include "Celestial.h"

Inheritance diagram for CelestialObject:
Collaboration diagram for CelestialObject:

Public Member Functions

 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)
 
virtual bool _Load ()
 
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 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)
 

Static Protected Member Functions

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

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
 

Additional Inherited Members

- Public Attributes inherited from InventoryItem
std::multimap< int8, fxDatam_modifiers
 
- 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...
 

Detailed Description

InventoryItem for generic celestial object.

Definition at line 57 of file Celestial.h.

Constructor & Destructor Documentation

CelestialObject::CelestialObject ( uint32  _celestialID,
const ItemType _type,
const ItemData _data 
)

Definition at line 47 of file Celestial.cpp.

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

Referenced by _LoadItem().

48 : InventoryItem(_celestialID, _type, _data),
49  m_radius( 0.0 ),
50  m_security( 0.0 ),
51  m_celestialIndex( 0 ),
52  m_orbitIndex( 0 )
53  {
54  _log(ITEM__TRACE, "Created Default CelestialObject %p for item %s (%u).", this, name(), itemID());
55 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
friend class InventoryItem
Definition: Celestial.h:60
uint8 m_orbitIndex
Definition: Celestial.h:104
double m_security
Definition: Celestial.h:102
double m_radius
Definition: Celestial.h:101
uint8 m_celestialIndex
Definition: Celestial.h:103
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

CelestialObject::CelestialObject ( uint32  _celestialID,
const ItemType _type,
const ItemData _data,
const CelestialObjectData _cData 
)

Definition at line 57 of file Celestial.cpp.

References _log, InventoryItem::itemID(), m_radius, and InventoryItem::name().

58 : InventoryItem(_celestialID, _type, _data),
59  m_radius(_cData.radius), // no longer needed here
60  m_security(_cData.security),
62  m_orbitIndex(_cData.orbitIndex)
63 {
64  _log(ITEM__TRACE, "Created CelestialObject %p for %s (%u) with radius of %.1f.", this, name(), itemID(), m_radius);
65 }
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * name()
friend class InventoryItem
Definition: Celestial.h:60
uint8 m_orbitIndex
Definition: Celestial.h:104
double m_security
Definition: Celestial.h:102
double m_radius
Definition: Celestial.h:101
uint8 m_celestialIndex
Definition: Celestial.h:103
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

virtual CelestialObject::~CelestialObject ( )
inlinevirtual

Definition at line 64 of file Celestial.h.

64 { /* do nothing here */ }

Member Function Documentation

template<class _Ty >
static RefPtr<_Ty> CelestialObject::_LoadItem ( uint32  celestialID,
const ItemType type,
const ItemData data 
)
inlinestaticprotected

Definition at line 82 of file Celestial.h.

References _log, ItemType::categoryID(), EVEDB::invCategories::Celestial, CelestialObject(), sConfig, sDataMgr, sItemFactory, and EvE::traceStack().

83  {
85  _log(ITEM__ERROR, "Trying to load %s as Celestial.", sDataMgr.GetCategoryName(type.categoryID()));
86  if (sConfig.debug.StackTrace)
88  return RefPtr<_Ty>();
89  }
90 
92  if (!sItemFactory.db()->GetCelestialObject(celestialID, cData))
93  return RefPtr<_Ty>();
94 
95  return CelestialObjectRef( new CelestialObject(celestialID, type, data, cData ) );
96  }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
RefPtr< CelestialObject > CelestialObjectRef
Definition: ItemRef.h:55
CelestialObject(uint32 _celestialID, const ItemType &_type, const ItemData &_data)
Definition: Celestial.cpp:47
uint8 categoryID() const
Definition: ItemType.h:66
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:

uint8 CelestialObject::celestialIndex ( ) const
inline

Definition at line 73 of file Celestial.h.

References m_celestialIndex.

73 { return m_celestialIndex; }
uint8 m_celestialIndex
Definition: Celestial.h:103
uint32 CelestialObject::CreateItemID ( ItemData data)
staticprotected

Definition at line 86 of file Celestial.cpp.

References InventoryItem::CreateItemID().

Referenced by Spawn().

86  {
87  return InventoryItem::CreateItemID(data);
88 }
static uint32 CreateItemID(ItemData &data)

Here is the call graph for this function:

Here is the caller graph for this function:

void CelestialObject::Delete ( )
virtual

Reimplemented from InventoryItem.

Definition at line 90 of file Celestial.cpp.

References InventoryItem::Delete().

90  {
92 }
virtual void Delete()

Here is the call graph for this function:

CelestialObjectRef CelestialObject::Load ( uint32  celestialID)
static

Definition at line 67 of file Celestial.cpp.

Referenced by Spawn().

68 {
69  return InventoryItem::Load<CelestialObject>(celestialID );
70 }

Here is the caller graph for this function:

uint8 CelestialObject::orbitIndex ( ) const
inline

Definition at line 74 of file Celestial.h.

References m_orbitIndex.

74 { return m_orbitIndex; }
uint8 m_orbitIndex
Definition: Celestial.h:104
double CelestialObject::radius ( ) const
inline

Definition at line 71 of file Celestial.h.

References m_radius.

71 { return m_radius; }
double m_radius
Definition: Celestial.h:101
double CelestialObject::security ( ) const
inline

Definition at line 72 of file Celestial.h.

References m_security.

72 { return m_security; }
double m_security
Definition: Celestial.h:102
CelestialObjectRef CelestialObject::Spawn ( ItemData data)
static

Definition at line 72 of file Celestial.cpp.

References AttrIsGlobal, EVEDB::invGroups::Beacon, CreateItemID(), EVEDB::invGroups::Effect_Beacon, EvilOne, and Load().

Referenced by InventoryItem::Spawn().

72  {
73  uint32 celestialID = CelestialObject::CreateItemID(data);
74  if (celestialID == 0 )
75  return CelestialObjectRef(nullptr);
76 
77  CelestialObjectRef celestialRef = CelestialObject::Load(celestialID);
78 
79  if ((celestialRef->type().groupID() == EVEDB::invGroups::Beacon)
80  or (celestialRef->type().groupID() == EVEDB::invGroups::Effect_Beacon))
81  celestialRef->SetAttribute(AttrIsGlobal, EvilOne);
82 
83  return celestialRef;
84 }
static CelestialObjectRef Load(uint32 celestialID)
Definition: Celestial.cpp:67
static uint32 CreateItemID(ItemData &data)
Definition: Celestial.cpp:86
RefPtr< CelestialObject > CelestialObjectRef
Definition: ItemRef.h:55
unsigned __int32 uint32
Definition: eve-compat.h:50
EvilNumber EvilOne
Definition: EvilNumber.cpp:34
Reference-counting-based smart pointer.
Definition: RefPtr.h:133

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class InventoryItem
friend

Definition at line 60 of file Celestial.h.

Member Data Documentation

uint8 CelestialObject::m_celestialIndex
protected

Definition at line 103 of file Celestial.h.

Referenced by celestialIndex().

uint8 CelestialObject::m_orbitIndex
protected

Definition at line 104 of file Celestial.h.

Referenced by orbitIndex().

double CelestialObject::m_radius
protected

Definition at line 101 of file Celestial.h.

Referenced by CelestialObject(), and radius().

double CelestialObject::m_security
protected

Definition at line 102 of file Celestial.h.

Referenced by security().


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