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

#include "Container.h"

Inheritance diagram for WreckSE:
Collaboration diagram for WreckSE:

Public Member Functions

 WreckSE (WreckContainerRef self, PyServiceMgr &services, SystemManager *system, const FactionData &data)
 
virtual ~WreckSE ()
 
virtual WreckSEGetWreckSE ()
 
virtual bool IsWreckSE ()
 
virtual void Process ()
 
virtual void EncodeDestiny (Buffer &into)
 
virtual PyDictMakeSlimItem ()
 
virtual void Abandon ()
 
void Salvaged ()
 
void SetLaunchedByID (uint32 launcherID)
 
bool IsEmpty ()
 
double GetOwnerBounty ()
 
- Public Member Functions inherited from DynamicSystemEntity
 DynamicSystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~DynamicSystemEntity ()
 
virtual DynamicSystemEntityGetDynamicSE ()
 
virtual bool IsDynamicEntity ()
 
virtual void UpdateDamage ()
 
virtual void MakeDamageState (DoDestinyDamageState &into)
 
virtual bool Load ()
 
virtual bool IsInvul ()
 
virtual bool IsFrozen ()
 
void AwardBounty (Client *pClient)
 
void SetInvul (bool invul=false)
 
void SetFrozen (bool frozen=false)
 
- Public Member Functions inherited from SystemEntity
 SystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~SystemEntity ()
 
virtual bool ProcessTic ()
 
virtual SystemEntityGetSE ()
 
virtual StaticSystemEntityGetStaticSE ()
 
virtual StationSEGetStationSE ()
 
virtual PlanetSEGetPlanetSE ()
 
virtual MoonSEGetMoonSE ()
 
virtual StargateSEGetGateSE ()
 
virtual BeltSEGetBeltSE ()
 
virtual ItemSystemEntityGetItemSE ()
 
virtual ContainerSEGetContSE ()
 
virtual AnomalySEGetAnomalySE ()
 
virtual WormholeSEGetWormholeSE ()
 
virtual FieldSEGetFieldSE ()
 
virtual ProbeSEGetProbeSE ()
 
virtual ObjectSystemEntityGetObjectSE ()
 
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 NPCGetNPCSE ()
 
virtual DroneSEGetDroneSE ()
 
virtual MissileGetMissileSE ()
 
virtual ShipSEGetShipSE ()
 
virtual ConcordGetConcordSE ()
 
virtual bool isGlobal ()
 
virtual bool IsSystemEntity ()
 
virtual bool IsInanimateSE ()
 
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 IsObjectEntity ()
 
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 IsLogin ()
 
virtual bool IsNPCSE ()
 
virtual bool IsDroneSE ()
 
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 ()
 
const bool IsDead ()
 
const GVectorGetVelocity ()
 
virtual void Killed (Damage &fatal_blow)
 
virtual void MissileLaunched (Missile *pMissile)
 
virtual bool LoadExtras ()
 
virtual void Delete ()
 
virtual void SetPilot (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 

Protected Attributes

WreckContainerRef m_contRef
 
Timer m_deleteTimer
 
uint32 m_launchedByID
 
- 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
 

Private Attributes

bool m_abandoned
 

Detailed Description

DynamicSystemEntity which represents wreck object in space Author: Allan

Definition at line 240 of file Container.h.

Constructor & Destructor Documentation

WreckSE::WreckSE ( WreckContainerRef  self,
PyServiceMgr services,
SystemManager system,
const FactionData data 
)

Definition at line 508 of file Container.cpp.

References FactionData::allianceID, AttrCapacity, ItemType::capacity(), FactionData::corporationID, FactionData::factionID, SystemEntity::m_allyID, SystemEntity::m_corpID, SystemEntity::m_destiny, SystemEntity::m_ownerID, SystemEntity::m_self, SystemEntity::m_targMgr, SystemEntity::m_warID, FactionData::ownerID, InventoryItem::SetAttribute(), and InventoryItem::type().

509 : DynamicSystemEntity(self, services, system),
510 m_deleteTimer(sConfig.rates.WorldDecay *60 *1000),
511 m_abandoned(false),
512 m_contRef(self)
513 {
514  assert(m_targMgr != nullptr);
515  assert(m_destiny != nullptr);
516 
517  m_warID = data.factionID;
518  m_allyID = data.allianceID;
519  m_corpID = data.corporationID;
520  m_ownerID = data.ownerID;
521 
523 }
#define sConfig
A macro for easier access to the singleton.
WreckContainerRef m_contRef
Definition: Container.h:270
DestinyManager * m_destiny
Definition: SystemEntity.h:265
uint32 m_ownerID
Definition: SystemEntity.h:283
float capacity() const
Definition: ItemType.h:71
TargetManager * m_targMgr
Definition: SystemEntity.h:264
const ItemType & type() const
bool m_abandoned
Definition: Container.h:277
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
void SetAttribute(uint16 attrID, int num, bool notify=true)
uint32 corporationID
Timer m_deleteTimer
Definition: Container.h:272
DynamicSystemEntity(InventoryItemRef self, PyServiceMgr &services, SystemManager *system)

Here is the call graph for this function:

WreckSE::~WreckSE ( )
virtual

Definition at line 525 of file Container.cpp.

526 {
527  // these are cleared in base class
528  //SafeDelete(m_targMgr);
529  //SafeDelete(m_destiny);
530 }

Member Function Documentation

void WreckSE::Abandon ( )
virtual

Reimplemented from SystemEntity.

Definition at line 543 of file Container.cpp.

References SystemEntity::Abandon(), and m_abandoned.

544 {
546  m_abandoned = true;
547 }
bool m_abandoned
Definition: Container.h:277
virtual void Abandon()

Here is the call graph for this function:

void WreckSE::EncodeDestiny ( Buffer into)
virtual

Reimplemented from DynamicSystemEntity.

Definition at line 549 of file Container.cpp.

References _log, Destiny::MassSector::allianceID, Buffer::Append(), Destiny::MassSector::cloak, Destiny::MassSector::corporationID, Destiny::TROLL_Struct::effectStamp, Destiny::BallHeader::entityID, Destiny::BallHeader::flags, Destiny::TROLL_Struct::formationID, SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetRadius(), Destiny::MassSector::harmonic, Destiny::DataSector::inertia, IsAlliance, Destiny::Ball::Flag::IsFree, Destiny::Ball::Flag::IsInteractive, SystemEntity::m_allyID, SystemEntity::m_corpID, SystemEntity::m_harmonic, SystemEntity::m_self, ItemType::mass(), Destiny::MassSector::mass, Destiny::DataSector::maxSpeed, Destiny::BallHeader::mode, Destiny::BallHeader::posX, Destiny::BallHeader::posY, Destiny::BallHeader::posZ, Destiny::BallHeader::radius, sEntityList, Destiny::DataSector::speedfraction, Destiny::Ball::Mode::TROLL, InventoryItem::type(), Destiny::DataSector::velX, Destiny::DataSector::velY, Destiny::DataSector::velZ, SystemEntity::x(), SystemEntity::y(), and SystemEntity::z().

550 {
551  using namespace Destiny;
552  BallHeader head = BallHeader();
553  head.entityID = GetID();
554  head.radius = GetRadius();
555  head.posX = x();
556  head.posY = y();
557  head.posZ = z();
558  head.mode = Ball::Mode::TROLL;
560  into.Append( head );
561  MassSector mass = MassSector();
562  mass.mass = m_self->type().mass();
563  mass.cloak = 0;
564  mass.harmonic = m_harmonic;
565  mass.corporationID = m_corpID;
566  mass.allianceID = (IsAlliance(m_allyID) ? m_allyID : -1);
567  into.Append( mass );
568  DataSector data = DataSector();
569  data.inertia = 1;
570  data.maxSpeed = 1;
571  data.velX = 0;
572  data.velY = 0;
573  data.velZ = 0;
574  data.speedfraction = 1;
575  into.Append( data );
576  TROLL_Struct troll;
577  troll.formationID = 0xFF;
578  troll.effectStamp = sEntityList.GetStamp();
579  into.Append( troll );
580  _log(SE__DESTINY, "WreckSE::EncodeDestiny(): %s - id:%li, mode:%u, flags:0x%X", GetName(), head.entityID, head.mode, head.flags);
581 }
void Append(const T &value)
Appends a single value to buffer.
Definition: Buffer.h:437
#define _log(type, fmt,...)
Definition: logsys.h:124
double GetRadius()
Definition: SystemEntity.h:208
double y()
Definition: SystemEntity.h:214
#define sEntityList
Definition: EntityList.h:208
int32 m_harmonic
Definition: SystemEntity.h:276
const ItemType & type() const
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
float mass() const
Definition: ItemType.h:69
double z()
Definition: SystemEntity.h:215
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
double x()
Definition: SystemEntity.h:213
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244

Here is the call graph for this function:

double WreckSE::GetOwnerBounty ( )
inline
Todo:
(allan) finish this

Definition at line 267 of file Container.h.

267 { return 0; }
virtual WreckSE* WreckSE::GetWreckSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 249 of file Container.h.

249 { return this; }
bool WreckSE::IsEmpty ( )
inline

Definition at line 264 of file Container.h.

References WreckContainer::IsEmpty(), and m_contRef.

264 { return m_contRef->IsEmpty(); }
bool IsEmpty()
Definition: Container.h:206
WreckContainerRef m_contRef
Definition: Container.h:270

Here is the call graph for this function:

virtual bool WreckSE::IsWreckSE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 251 of file Container.h.

251 { return true; }
PyDict * WreckSE::MakeSlimItem ( )
virtual

Reimplemented from DynamicSystemEntity.

Definition at line 583 of file Container.cpp.

References _log, PyRep::Dump(), SystemEntity::GetID(), SystemEntity::GetName(), is_log_enabled, IsAlliance, IsCorp, WreckContainer::IsEmpty(), IsFaction, IsFleetID, InventoryItem::itemID(), InventoryItem::itemName(), Profile::loot, m_abandoned, SystemEntity::m_allyID, m_contRef, SystemEntity::m_corpID, SystemEntity::m_fleetID, m_launchedByID, SystemEntity::m_ownerID, SystemEntity::m_self, SystemEntity::m_warID, InventoryItem::name(), PyStatic, PyTuple::SetItem(), PyDict::SetItem(), PyDict::SetItemString(), and InventoryItem::typeID().

583  {
584  _log(SE__SLIMITEM, "MakeSlimItem for WreckSE %s(%u)", m_self->name(), m_self->itemID());
585  PyTuple* nameID = new PyTuple(2);
586  nameID->SetItem(0, new PyString("UI/Inflight/WreckNameShipName"));
587  PyDict* shipName = new PyDict;
588  shipName->SetItem("shipName", new PyInt(0)); // does this need data here?
589  nameID->SetItem(1, shipName);
590  PyDict *slim = new PyDict();
591  slim->SetItemString("itemID", new PyLong(m_self->itemID()));
592  slim->SetItemString("typeID", new PyInt(m_self->typeID()));
593  slim->SetItemString("name", new PyString(m_self->itemName()));
594  if (m_abandoned or (m_fleetID)) { // this is ONLY for abandoned wrecks or wrecks from fleet ops
595  PyTuple* loot = new PyTuple(4);
596  loot->SetItem(0, new PyInt(m_ownerID));
597  loot->SetItem(1, IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
598  loot->SetItem(2, IsFleetID(m_fleetID) ? new PyInt(m_fleetID) : PyStatic.NewNone());
599  loot->SetItem(3, new PyBool(false)); // what is this??
600  slim->SetItemString("lootRights", loot );
601  }
602  slim->SetItemString("corpID", IsCorp(m_corpID) ? new PyInt(m_corpID) : PyStatic.NewNone());
603  slim->SetItemString("allianceID", IsAlliance(m_allyID) ? new PyInt(m_allyID) : PyStatic.NewNone());
604  slim->SetItemString("warFactionID", IsFaction(m_warID) ? new PyInt(m_warID) : PyStatic.NewNone());
605  slim->SetItemString("isEmpty", new PyBool(m_contRef->IsEmpty()));
606  slim->SetItemString("launcherID", new PyLong(m_launchedByID));
607  slim->SetItemString("securityStatus", new PyInt(0)); //FIXME TODO
608  slim->SetItemString("ownerID", new PyInt(m_ownerID));
609  PyDict* dict = new PyDict;
610  dict->SetItemString("WreckTypeID", new PyInt(m_self->typeID()));
611  PyTuple* tuple2 = new PyTuple(2);
612  tuple2->SetItem(0, new PyString("UI/Inflight/WreckNameTypeID"));
613  tuple2->SetItem(1, dict);
614  slim->SetItemString("nameID", tuple2);
615 
616  if (is_log_enabled(DESTINY__DEBUG)) {
617  _log( DESTINY__DEBUG, "WreckSE::MakeSlimItem() - %s(%u)", GetName(), GetID());
618  slim->Dump(DESTINY__DEBUG, " ");
619  }
620 
621  return slim;
622 }
bool IsEmpty()
Definition: Container.h:206
WreckContainerRef m_contRef
Definition: Container.h:270
#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
const char * name()
Python tuple.
Definition: PyRep.h:567
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
Python boolean.
Definition: PyRep.h:323
#define is_log_enabled(type)
Definition: logsys.h:78
uint32 m_fleetID
Definition: SystemEntity.h:282
bool m_abandoned
Definition: Container.h:277
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
Python integer.
Definition: PyRep.h:231
uint32 GetID()
Definition: SystemEntity.h:207
#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 IsFleetID(itemID)
Definition: EVE_Defines.h:225
#define IsFaction(itemID)
Definition: EVE_Defines.h:250
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
uint16 typeID() const
uint32 itemID() const
Definition: InventoryItem.h:98
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
uint32 m_launchedByID
Definition: Container.h:274
Python long integer.
Definition: PyRep.h:261

Here is the call graph for this function:

void WreckSE::Process ( )
virtual

Reimplemented from SystemEntity.

Definition at line 532 of file Container.cpp.

References Timer::Check(), SystemEntity::Delete(), Timer::Disable(), InventoryItem::itemID(), m_contRef, m_deleteTimer, SystemEntity::Process(), and sLog.

532  {
533  /* Enable base call to Process Targeting and Movement */
535  if (m_deleteTimer.Check(false)) {
537  sLog.Magenta( "WreckSE::Process()", "Garbage Collection is removing Wreck %u.", m_contRef->itemID() );
538  Delete();
539  delete this;
540  }
541 }
virtual void Process()
WreckContainerRef m_contRef
Definition: Container.h:270
void Disable()
Definition: timer.h:39
virtual void Delete()
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool Check(bool reset=true)
Definition: timer.cpp:62
Timer m_deleteTimer
Definition: Container.h:272
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

void WreckSE::Salvaged ( )
inline

Definition at line 262 of file Container.h.

References m_contRef, and WreckContainer::Salvaged().

Referenced by Prospector::DropSalvage().

262 { m_contRef->Salvaged(); }
WreckContainerRef m_contRef
Definition: Container.h:270
void Salvaged()
Definition: Container.h:209

Here is the call graph for this function:

Here is the caller graph for this function:

void WreckSE::SetLaunchedByID ( uint32  launcherID)
inline

Definition at line 263 of file Container.h.

References m_launchedByID.

Referenced by SystemManager::BuildDynamicEntity().

263 { m_launchedByID = launcherID; }
uint32 m_launchedByID
Definition: Container.h:274

Here is the caller graph for this function:

Member Data Documentation

bool WreckSE::m_abandoned
private

Definition at line 277 of file Container.h.

Referenced by Abandon(), and MakeSlimItem().

WreckContainerRef WreckSE::m_contRef
protected

Definition at line 270 of file Container.h.

Referenced by IsEmpty(), MakeSlimItem(), Process(), and Salvaged().

Timer WreckSE::m_deleteTimer
protected

Definition at line 272 of file Container.h.

Referenced by Process().

uint32 WreckSE::m_launchedByID
protected

Definition at line 274 of file Container.h.

Referenced by MakeSlimItem(), and SetLaunchedByID().


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