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

#include "SystemEntity.h"

Inheritance diagram for ObjectSystemEntity:
Collaboration diagram for ObjectSystemEntity:

Public Member Functions

 ObjectSystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~ObjectSystemEntity ()
 
virtual ObjectSystemEntityGetObjectSE ()
 
virtual bool IsInanimateSE ()
 
virtual bool IsObjectEntity ()
 
virtual void UpdateDamage ()
 
virtual void EncodeDestiny (Buffer &into)
 
virtual void MakeDamageState (DoDestinyDamageState &into)
 
virtual PyDictMakeSlimItem ()
 
virtual void Killed (Damage &fatal_blow)
 
virtual bool IsInvul ()
 
void SetInvul (bool invul=false)
 
- Public Member Functions inherited from SystemEntity
 SystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~SystemEntity ()
 
virtual void Process ()
 
virtual bool ProcessTic ()
 
virtual SystemEntityGetSE ()
 
virtual StaticSystemEntityGetStaticSE ()
 
virtual StationSEGetStationSE ()
 
virtual PlanetSEGetPlanetSE ()
 
virtual MoonSEGetMoonSE ()
 
virtual StargateSEGetGateSE ()
 
virtual BeltSEGetBeltSE ()
 
virtual ItemSystemEntityGetItemSE ()
 
virtual ContainerSEGetContSE ()
 
virtual WreckSEGetWreckSE ()
 
virtual AnomalySEGetAnomalySE ()
 
virtual WormholeSEGetWormholeSE ()
 
virtual FieldSEGetFieldSE ()
 
virtual ProbeSEGetProbeSE ()
 
virtual AsteroidSEGetAsteroidSE ()
 
virtual StructureSEGetPOSSE ()
 
virtual StructureSEGetJammerSE ()
 
virtual JumpBridgeSEGetJumpBridgeSE ()
 
virtual StructureSEGetOutpostSE ()
 
virtual TowerSEGetTowerSE ()
 
virtual ArraySEGetArraySE ()
 
virtual WeaponSEGetWeaponSE ()
 
virtual BatterySEGetBatterySE ()
 
virtual DeployableSEGetDeployableSE ()
 
virtual SentryGetSentrySE ()
 
virtual ModuleSEGetModuleSE ()
 
virtual ReactorSEGetReactorSE ()
 
virtual CustomsSEGetCOSE ()
 
virtual TCUSEGetTCUSE ()
 
virtual SBUSEGetSBUSE ()
 
virtual IHubSEGetIHubSE ()
 
virtual DynamicSystemEntityGetDynamicSE ()
 
virtual NPCGetNPCSE ()
 
virtual DroneSEGetDroneSE ()
 
virtual MissileGetMissileSE ()
 
virtual ShipSEGetShipSE ()
 
virtual ConcordGetConcordSE ()
 
virtual bool isGlobal ()
 
virtual bool IsSystemEntity ()
 
virtual bool IsStaticEntity ()
 
virtual bool IsBeltSE ()
 
virtual bool IsGateSE ()
 
virtual bool IsPlanetSE ()
 
virtual bool IsMoonSE ()
 
virtual bool IsStationSE ()
 
virtual bool IsItemEntity ()
 
virtual bool IsAnomalySE ()
 
virtual bool IsWormholeSE ()
 
virtual bool IsCelestialSE ()
 
virtual bool IsContainerSE ()
 
virtual bool IsFieldSE ()
 
virtual bool IsProbeSE ()
 
virtual bool IsSentrySE ()
 
virtual bool IsPOSSE ()
 
virtual bool IsCOSE ()
 
virtual bool IsTCUSE ()
 
virtual bool IsSBUSE ()
 
virtual bool IsIHubSE ()
 
virtual bool IsTowerSE ()
 
virtual bool IsArraySE ()
 
virtual bool IsJammerSE ()
 
virtual bool IsWeaponSE ()
 
virtual bool IsBatterySE ()
 
virtual bool IsModuleSE ()
 
virtual bool IsMoonMiner ()
 
virtual bool IsOutpostSE ()
 
virtual bool IsAsteroidSE ()
 
virtual bool IsDeployableSE ()
 
virtual bool IsJumpBridgeSE ()
 
virtual bool IsReactorSE ()
 
virtual bool IsOperSE ()
 
virtual bool IsDynamicEntity ()
 
virtual bool IsLogin ()
 
virtual bool IsFrozen ()
 
virtual bool IsNPCSE ()
 
virtual bool IsDroneSE ()
 
virtual bool IsWreckSE ()
 
virtual bool IsMissileSE ()
 
virtual bool IsShipSE ()
 
virtual bool IsConcord ()
 
PyServiceMgrGetServices ()
 
SystemBubbleSysBubble ()
 
SystemManagerSystemMgr ()
 
TargetManagerTargetMgr ()
 
DestinyManagerDestinyMgr ()
 
InventoryItemRef GetSelf ()
 
uint16 GetTypeID ()
 
uint32 GetGroupID ()
 
uint8 GetCategoryID ()
 
EVEItemFlags GetFlag ()
 
uint32 GetID ()
 
double GetRadius ()
 
uint32 GetLocationID ()
 
const char * GetName () const
 
const GPointGetPosition () const
 
void SetPosition (const GPoint &pos)
 
double x ()
 
double y ()
 
double z ()
 
int32 GetAllianceID ()
 
int32 GetWarFactionID ()
 
uint32 GetCorporationID ()
 
uint32 GetOwnerID ()
 
uint32 GetFleetID ()
 
void SetFleetID (uint32 set)
 
int8 GetHarmonic ()
 
void SetHarmonic (int8 set)
 
void DropLoot (WreckContainerRef wreckRef, uint32 groupID, uint32 owner)
 
void AwardSecurityStatus (InventoryItemRef iRef, Character *pChar)
 
void SendDamageStateChanged ()
 
bool ApplyDamage (Damage &d)
 
double DistanceTo2 (const SystemEntity *other)
 
PyTupleMakeDamageState ()
 
virtual void Abandon ()
 
const bool IsDead ()
 
const GVectorGetVelocity ()
 
virtual void MissileLaunched (Missile *pMissile)
 
virtual bool LoadExtras ()
 
virtual void Delete ()
 
virtual void SetPilot (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 

Private Attributes

bool m_invul
 

Additional Inherited Members

- Protected Attributes inherited from SystemEntity
SystemBubblem_bubble
 
SystemManagerm_system
 
TargetManagerm_targMgr
 
DestinyManagerm_destiny
 
PyServiceMgrm_services
 
InventoryItemRef m_self
 
bool m_killed
 
double m_radius
 
int32 m_harmonic
 
int32 m_warID
 
int32 m_allyID
 
uint32 m_corpID
 
uint32 m_fleetID
 
uint32 m_ownerID
 

Detailed Description

Definition at line 420 of file SystemEntity.h.

Constructor & Destructor Documentation

ObjectSystemEntity::ObjectSystemEntity ( InventoryItemRef  self,
PyServiceMgr services,
SystemManager system 
)

Definition at line 493 of file SystemEntity.cpp.

References SystemEntity::m_destiny, and SystemEntity::m_targMgr.

494 : SystemEntity(self, services, system),
495 m_invul(false)
496 {
497  m_targMgr = new TargetManager(this);
498  m_destiny = new DestinyManager(this);
499 
500  assert(m_targMgr != nullptr);
501  assert(m_destiny != nullptr);
502 }
DestinyManager * m_destiny
Definition: SystemEntity.h:265
TargetManager * m_targMgr
Definition: SystemEntity.h:264
SystemEntity(InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
ObjectSystemEntity::~ObjectSystemEntity ( )
virtual

Definition at line 504 of file SystemEntity.cpp.

References TargetManager::ClearAllTargets(), TargetManager::ClearModules(), SystemEntity::m_destiny, SystemEntity::m_targMgr, SafeDelete(), and sConsole.

505 {
506  if (m_targMgr != nullptr)
507  if (!sConsole.IsShutdown()) {
509  m_targMgr->ClearAllTargets(false);
510  //m_targMgr->OnTarget(nullptr, TargMgr::Mode::Clear, TargMgr::Msg::Destroyed);
511  }
512 
515 }
#define sConsole
DestinyManager * m_destiny
Definition: SystemEntity.h:265
void ClearAllTargets(bool notify=true)
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
TargetManager * m_targMgr
Definition: SystemEntity.h:264

Here is the call graph for this function:

Member Function Documentation

void ObjectSystemEntity::EncodeDestiny ( Buffer into)
virtual

Reimplemented from SystemEntity.

Reimplemented in AsteroidSE, CustomsSE, and Sentry.

Definition at line 517 of file SystemEntity.cpp.

References _log, Buffer::Append(), Destiny::BallHeader::entityID, Destiny::BallHeader::flags, Destiny::RIGID_Struct::formationID, SystemEntity::GetName(), Destiny::Ball::Flag::IsMassive, InventoryItem::itemID(), SystemEntity::m_radius, SystemEntity::m_self, main(), Destiny::BallHeader::mode, Destiny::BallHeader::posX, Destiny::BallHeader::posY, Destiny::BallHeader::posZ, Destiny::BallHeader::radius, Destiny::Ball::Mode::RIGID, SystemEntity::x(), SystemEntity::y(), and SystemEntity::z().

518 {
519  using namespace Destiny;
520  BallHeader head = BallHeader();
521  head.entityID = m_self->itemID();
522  head.mode = Ball::Mode::RIGID;
523  head.radius = m_radius;
524  head.posX = x();
525  head.posY = y();
526  head.posZ = z();
528  into.Append( head );
530  main.formationID = 0xFF;
531  into.Append( main );
532 
533  _log(SE__DESTINY, "OSE::EncodeDestiny(): %s - id:%li, mode:%u, flags:0x%X", GetName(), head.entityID, head.mode, head.flags);
534 }
void Append(const T &value)
Appends a single value to buffer.
Definition: Buffer.h:437
#define _log(type, fmt,...)
Definition: logsys.h:124
double y()
Definition: SystemEntity.h:214
InventoryItemRef m_self
Definition: SystemEntity.h:269
double z()
Definition: SystemEntity.h:215
const char * GetName() const
Definition: SystemEntity.h:210
double x()
Definition: SystemEntity.h:213
int main(int argc, char *argv[])
double m_radius
Definition: SystemEntity.h:273
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

virtual ObjectSystemEntity* ObjectSystemEntity::GetObjectSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 426 of file SystemEntity.h.

426 { return this; }
virtual bool ObjectSystemEntity::IsInanimateSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 430 of file SystemEntity.h.

430 { return true; }
virtual bool ObjectSystemEntity::IsInvul ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 443 of file SystemEntity.h.

References m_invul.

443 { return m_invul; }
virtual bool ObjectSystemEntity::IsObjectEntity ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 432 of file SystemEntity.h.

432 { return true; }
void ObjectSystemEntity::Killed ( Damage fatal_blow)
virtual
Todo:
test and complete this to null current customs office for this planet ...

Reimplemented from SystemEntity.

Reimplemented in CustomsSE, and Sentry.

Definition at line 575 of file SystemEntity.cpp.

References SystemEntity::GetCOSE(), SystemEntity::GetPlanetSE(), SystemManager::GetSE(), SystemEntity::IsCOSE(), SystemEntity::m_system, and PlanetSE::SetCustomsOffice().

576 {
577  // do we need to make wreck items here?
578  // do these structures have loot? probably so eventually
579 
581  if (IsCOSE()) {
582  if (GetCOSE()->GetPlanetID() > 0) {
583  SystemEntity* pSE = m_system->GetSE(GetCOSE()->GetPlanetID());
584  pSE->GetPlanetSE()->SetCustomsOffice(nullptr);
585  }
586  }
587 }
SystemEntity * GetSE(uint32 entityID) const
virtual PlanetSE * GetPlanetSE()
Definition: SystemEntity.h:101
void SetCustomsOffice(CustomsSE *pSE)
Definition: Planet.h:67
virtual CustomsSE * GetCOSE()
Definition: SystemEntity.h:128
virtual bool IsCOSE()
Definition: SystemEntity.h:164
SystemManager * m_system
Definition: SystemEntity.h:263

Here is the call graph for this function:

void ObjectSystemEntity::MakeDamageState ( DoDestinyDamageState &  into)
virtual

Reimplemented from SystemEntity.

Reimplemented in AsteroidSE.

Definition at line 551 of file SystemEntity.cpp.

References AttrArmorDamage, AttrArmorHP, AttrDamage, AttrHP, AttrShieldCapacity, AttrShieldCharge, AttrShieldRechargeRate, EvilNumber::get_double(), InventoryItem::GetAttribute(), GetFileTimeNow(), and SystemEntity::m_self.

551  {
554  into.timestamp = GetFileTimeNow();
556  into.structure = 1.0 - (m_self->GetAttribute(AttrDamage).get_double() / m_self->GetAttribute(AttrHP).get_double());
557 }
InventoryItemRef m_self
Definition: SystemEntity.h:269
double GetFileTimeNow()
Definition: utils_time.cpp:84
EvilNumber GetAttribute(const uint16 attrID) const
double get_double()
Definition: EvilNumber.cpp:191

Here is the call graph for this function:

PyDict * ObjectSystemEntity::MakeSlimItem ( )
virtual

Reimplemented from SystemEntity.

Reimplemented in CustomsSE.

Definition at line 536 of file SystemEntity.cpp.

References _log, InventoryItem::categoryID(), SystemEntity::GetName(), SystemEntity::GetTypeID(), InventoryItem::groupID(), IsAlliance, IsCorp, IsFaction, InventoryItem::itemID(), InventoryItem::itemName(), SystemEntity::m_allyID, SystemEntity::m_corpID, SystemEntity::m_ownerID, SystemEntity::m_self, SystemEntity::m_warID, and PyStatic.

536  {
537  _log(SE__SLIMITEM, "MakeSlimItem for OSE %s(%u)", GetName(), m_self->itemID());
538  PyDict *slim = new PyDict();
539  slim->SetItemString("itemID", new PyLong(m_self->itemID()));
540  slim->SetItemString("typeID", new PyInt(GetTypeID()));
541  slim->SetItemString("ownerID", new PyInt(m_ownerID));
542  slim->SetItemString("categoryID", new PyInt(m_self->categoryID()));
543  slim->SetItemString("groupID", new PyInt(m_self->groupID()));
544  slim->SetItemString("name", new PyString(m_self->itemName()));
545  slim->SetItemString("corpID", IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
546  slim->SetItemString("allianceID", IsAlliance(m_allyID) ? new PyInt(m_allyID) : PyStatic.NewNone());
547  slim->SetItemString("warFactionID", IsFaction(m_warID) ? new PyInt(m_warID) : PyStatic.NewNone());
548  return slim;
549 }
#define _log(type, fmt,...)
Definition: logsys.h:124
Python string.
Definition: PyRep.h:430
Python's dictionary.
Definition: PyRep.h:719
uint32 m_ownerID
Definition: SystemEntity.h:283
uint16 groupID() const
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
Python integer.
Definition: PyRep.h:231
#define PyStatic
Definition: PyRep.h:1209
const char * GetName() const
Definition: SystemEntity.h:210
#define IsCorp(itemID)
Definition: EVE_Defines.h:234
const std::string & itemName() const
#define IsFaction(itemID)
Definition: EVE_Defines.h:250
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244
uint16 GetTypeID()
Definition: SystemEntity.h:203
uint8 categoryID() const
uint32 itemID() const
Definition: InventoryItem.h:98
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

void ObjectSystemEntity::SetInvul ( bool  invul = false)
inline

Definition at line 446 of file SystemEntity.h.

References m_invul.

446 { m_invul = invul; }
void ObjectSystemEntity::UpdateDamage ( )
virtual

Reimplemented from SystemEntity.

Definition at line 559 of file SystemEntity.cpp.

References AttrArmorDamage, AttrArmorHP, AttrDamage, AttrHP, AttrShieldCapacity, AttrShieldCharge, AttrShieldRechargeRate, EvilNumber::get_double(), InventoryItem::GetAttribute(), GetFileTimeNow(), InventoryItem::itemID(), SystemEntity::m_self, and SystemEntity::UpdateDamage().

560 {
562  DamageDetails dmgState;
564  dmgState.recharge = m_self->GetAttribute(AttrShieldRechargeRate).get_double();
565  dmgState.timestamp = GetFileTimeNow();
567  dmgState.structure = 1.0 - m_self->GetAttribute(AttrDamage).get_double() / m_self->GetAttribute(AttrHP).get_double();
568  OnDamageStateChange dmgChange;
569  dmgChange.entityID = m_self->itemID();
570  dmgChange.state = dmgState.Encode();
571  PyTuple *up = dmgChange.Encode();
572  //source->QueueDestinyUpdate(&up);
573 }
Python tuple.
Definition: PyRep.h:567
InventoryItemRef m_self
Definition: SystemEntity.h:269
virtual void UpdateDamage()
Definition: SystemEntity.h:250
double GetFileTimeNow()
Definition: utils_time.cpp:84
EvilNumber GetAttribute(const uint16 attrID) const
double get_double()
Definition: EvilNumber.cpp:191
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Member Data Documentation

bool ObjectSystemEntity::m_invul
private

Definition at line 449 of file SystemEntity.h.

Referenced by IsInvul(), and SetInvul().


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