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

#include "SystemManager.h"

Static Public Member Functions

static SystemEntityBuildEntity (SystemManager &pSysMgr, const DBSystemDynamicEntity &entity)
 

Detailed Description

Definition at line 54 of file SystemManager.h.

Member Function Documentation

SystemEntity * DynamicEntityFactory::BuildEntity ( SystemManager pSysMgr,
const DBSystemDynamicEntity entity 
)
static
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
(Allan) need to separate these by class to create proper SE (started)
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
this needs its own class....there are 477 types, spawning everything..rats, modules, items, etc.
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here
Todo:
make error msg here

Definition at line 545 of file SystemManager.cpp.

References _log, FactionData::allianceID, DBSystemDynamicEntity::allianceID, EVEDB::invGroups::Assembly_Array, EVEDB::invCategories::Asteroid, EVEDB::invGroups::Asteroid_Angel_Cartel_Commander_Frigate, EVEDB::invGroups::Asteroid_Angel_Cartel_Frigate, EVEDB::invGroups::Asteroid_Rogue_Drone_Battlecruiser, EVEDB::invGroups::Asteroid_Rogue_Drone_Commander_Battlecruiser, EVEDB::invGroups::Asteroid_Rogue_Drone_Swarm, EVEDB::invGroups::Asteroid_Serpentis_BattleCruiser, EVEDB::invGroups::Asteroid_Serpentis_Commander_Battleship, EVEDB::invGroups::Asteroid_Serpentis_Commander_Frigate, AttrRadius, EVEDB::invGroups::Audit_Log_Secure_Container, EVEDB::invGroups::Beacon, EVEDB::invGroups::Biomass, EVEDB::invGroups::Cargo_Container, DBSystemDynamicEntity::categoryID, EVEDB::invCategories::Celestial, EVEDB::invCategories::Charge, EVEDB::invGroups::Cloud, EVEDB::invGroups::Comet, EVEDB::invGroups::Concord_Drone, EVEDB::invGroups::Construction_Platform, EVEDB::invGroups::Control_Tower, EVEDB::invGroups::Convoy, EVEDB::invGroups::Convoy_Drone, EVEDB::invGroups::Corporate_Hangar_Array, FactionData::corporationID, DBSystemDynamicEntity::corporationID, EVEDB::invGroups::Cosmic_Anomaly, EVEDB::invGroups::Cosmic_Signature, EVEDB::invGroups::Covert_Beacon, EVEDB::invGroups::Customs_Official, EVEDB::invGroups::Deadspace_Angel_Cartel_BattleCruiser, EVEDB::invGroups::Deadspace_Angel_Cartel_Frigate, EVEDB::invGroups::Deadspace_Blood_Raiders_BattleCruiser, EVEDB::invGroups::Deadspace_Blood_Raiders_Frigate, EVEDB::invGroups::Deadspace_Guristas_BattleCruiser, EVEDB::invGroups::Deadspace_Guristas_Frigate, EVEDB::invGroups::Deadspace_Overseer, EVEDB::invGroups::Deadspace_Overseer_s_Belongings, EVEDB::invGroups::Deadspace_Overseer_s_Sentry, EVEDB::invGroups::Deadspace_Overseer_s_Structure, EVEDB::invGroups::Deadspace_Sanshas_Nation_BattleCruiser, EVEDB::invGroups::Deadspace_Sanshas_Nation_Frigate, EVEDB::invGroups::Deadspace_Serpentis_BattleCruiser, EVEDB::invGroups::Deadspace_Serpentis_Frigate, EVEDB::invGroups::Deadspace_Sleeper_Awakened_Sentinel, EVEDB::invGroups::Deadspace_Sleeper_Emergent_Patroller, EVEDB::invGroups::Deadspace_Sleeper_Emergent_Sentinel, EVEDB::invGroups::Deadspace_Sleeper_Sleepless_Defender, EVEDB::invGroups::Deadspace_Sleeper_Sleepless_Sentinel, EVEDB::invCategories::Deployable, EVEDB::invGroups::Destructable_Station_Services, EVEDB::invGroups::Destructible_Agents_In_Space, EVEDB::invGroups::Destructible_Sentry_Gun, EVEDB::invCategories::Drone, Profile::drone, EVEDB::invGroups::Effect_Beacon, EVEDB::invGroups::Electronic_Warfare_Battery, EVEDB::invGroups::Energy_Neutralizing_Battery, EVEDB::invCategories::Entity, EVEDB::invGroups::Faction_Drone, FactionData::factionID, DBSystemDynamicEntity::factionID, EVEDB::invGroups::Force_Field, EVEDB::invGroups::Force_Field_Array, EVEDB::invGroups::Freight_Container, RefPtr< X >::get(), InventoryItem::GetMyInventory(), SystemEntity::GetPlanetSE(), SystemManager::GetSE(), SystemManager::GetServiceMgr(), EVEDB::invGroups::Global_Warp_Disruptor, DBSystemDynamicEntity::groupID, EVEDB::invGroups::Harvestable_Cloud, EVEDB::invGroups::Incursion_Sanshas_Nation_Battleship, EVEDB::invGroups::Incursion_Sanshas_Nation_Capital, EVEDB::invGroups::Incursion_Sanshas_Nation_Cruiser, EVEDB::invGroups::Incursion_Sanshas_Nation_Frigate, EVEDB::invGroups::Incursion_Sanshas_Nation_Industrial, EVEDB::invGroups::Infrastructure_Hubs, CustomsSE::Init(), SystemEntity::IsPlanetSE(), DBSystemDynamicEntity::itemID, DBSystemDynamicEntity::itemName, EVEDB::invGroups::Jump_Portal_Array, EVEDB::invGroups::Landmark, EVEDB::invGroups::Large_Collidable_Object, EVEDB::invGroups::Large_Collidable_Ship, EVEDB::invGroups::Large_Collidable_Structure, EVEDB::invGroups::LCO_Drone, NPC::Load(), Inventory::LoadContents(), EVEDB::invGroups::Logistics_Array, EVEDB::invGroups::Mission_Amarr_Empire_Carrier, EVEDB::invGroups::Mission_Amarr_Empire_Frigate, EVEDB::invGroups::Mission_Drone, EVEDB::invGroups::Mission_Faction_Cruiser, EVEDB::invGroups::Mission_Faction_Frigate, EVEDB::invGroups::Mission_Faction_Industrials, EVEDB::invGroups::Mission_Faction_Transports, EVEDB::invGroups::Mission_Fighter_Drone, EVEDB::invGroups::Mission_Generic_Battleships, EVEDB::invGroups::Mission_Generic_Destroyers, EVEDB::invGroups::Mission_Minmatar_Republic_Battleship, EVEDB::invGroups::Mission_Minmatar_Republic_Carrier, EVEDB::invGroups::Mobile_Hybrid_Sentry, EVEDB::invGroups::Mobile_Laser_Sentry, EVEDB::invGroups::Mobile_Missile_Sentry, EVEDB::invGroups::Mobile_Projectile_Sentry, EVEDB::invGroups::Mobile_Reactor, EVEDB::invGroups::Mobile_Sentry_Gun, EVEDB::invGroups::Moon_Mining, Dungeon::Event::Msg::NPC, EVEDB::invGroups::Orbital_Construction_Platform, EVEDB::invGroups::Orbital_Infrastructure, EVEDB::invCategories::Orbitals, FactionData::ownerID, DBSystemDynamicEntity::ownerID, EVEDB::invGroups::Pirate_Drone, EVEDB::invGroups::Planetary_Cloud, DBSystemDynamicEntity::planetID, EVEDB::invGroups::Police_Drone, EVEDB::invGroups::Protective_Sentry_Gun, ItemType::radius(), EVEDB::invGroups::Refining_Array, EVEDB::invGroups::Ring, EVEDB::invGroups::Rogue_Drone, EVEDB::invGroups::Scanner_Array, EVEDB::invGroups::Scanner_Probe, EVEDB::invGroups::Secondary_Sun, EVEDB::invGroups::Secure_Cargo_Container, EVEDB::invGroups::Sensor_Dampening_Battery, sEntityList, EVEDB::invGroups::Sentry_Gun, InventoryItem::SetAttribute(), PlanetSE::SetCustomsOffice(), CargoContainer::SetMySE(), WreckContainer::SetMySE(), CustomsSE::SetPlanet(), EVEDB::invGroups::Shield_Hardening_Array, EVEDB::invCategories::Ship, ship, EVEDB::invGroups::Ship_Maintenance_Array, EVEDB::invGroups::Shipping_Crates, EVEDB::invGroups::Silo, sItemFactory, sLog, EVEDB::invGroups::Sovereignty_Blockade_Units, EVEDB::invCategories::SovereigntyStructure, EVEDB::invGroups::Spawn_Container, EVEDB::invGroups::Stasis_Webification_Battery, EVEDB::invGroups::Station_Improvement_Platform, EVEDB::invGroups::Station_Upgrade_Platform, EVEDB::invGroups::Stealth_Emitter_Array, EVEDB::invGroups::Storyline_Battleship, EVEDB::invGroups::Storyline_Cruiser, EVEDB::invGroups::Storyline_Frigate, EVEDB::invGroups::Storyline_Mission_Battleship, EVEDB::invGroups::Storyline_Mission_Cruiser, EVEDB::invGroups::Storyline_Mission_Frigate, EVEDB::invCategories::Structure, EVEDB::invGroups::Structure_Repair_Array, EVEDB::invCategories::StructureUpgrade, EVEDB::invGroups::Survey_Probe, EVEDB::invGroups::Target_Painting_Battery, EVEDB::invGroups::Territorial_Claim_Units, EVEDB::invGroups::Test_Orbitals, EvE::traceStack(), EVEDB::invGroups::Tutorial_Drone, InventoryItem::type(), DBSystemDynamicEntity::typeID, EVEDB::invGroups::Warp_Disruption_Probe, EVEDB::invGroups::Warp_Gate, EVEDB::invGroups::Warp_Scrambling_Battery, EVEDB::invGroups::Wormhole, and EVEDB::invGroups::Wreck.

Referenced by SystemManager::BuildDynamicEntity(), SystemManager::LoadPlayerDynamics(), and SystemManager::LoadSystemDynamics().

546 {
547  FactionData data = FactionData();
548  data.allianceID = entity.allianceID;
549  data.corporationID = entity.corporationID;
550  data.factionID = entity.factionID;
551  data.ownerID = entity.ownerID;
552 
553  switch (entity.categoryID) {
555  InventoryItemRef asteroid = sItemFactory.GetItem( entity.itemID );
556  if (asteroid.get() == nullptr)
557  ;
558  AsteroidSE* aSE = new AsteroidSE(asteroid, *(sysMgr.GetServiceMgr()), &sysMgr);
559  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making AsteroidSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
560  return aSE;
561  } break;
563  ShipItemRef ship = sItemFactory.GetShip( entity.itemID );
564  if (ship.get() == nullptr)
565  return nullptr;
567  ShipSE* sSE = new ShipSE(ship, *(sysMgr.GetServiceMgr()), &sysMgr, data);
568  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making ShipSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
569  return sSE;
570  } break;
572  InventoryItemRef deployable = sItemFactory.GetItem( entity.itemID );
573  if (deployable.get() == nullptr)
574  return nullptr;
576  deployable->SetAttribute(AttrRadius, deployable->type().radius()); // Can you set this somehow from the type class ?
577  DeployableSE* dSE = new DeployableSE(deployable, *(sysMgr.GetServiceMgr()), &sysMgr, data);
578  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making DeployableSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
579  return dSE;
580  } break;
581  // these should go into m_staticEntities
582  case EVEDB::invCategories::StructureUpgrade: // SOV upgrade structures these may need their own class one day.
583  case EVEDB::invCategories::Structure: { // POS items
584  StructureItemRef structure = sItemFactory.GetStructure( entity.itemID );
585  if (structure.get() == nullptr)
586  return nullptr;
588  StructureSE* pSSE(nullptr);
589  switch(entity.groupID) {
591  TowerSE* tSE = new TowerSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
592  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making TowerSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
593  pSSE = tSE;
594  } break;
599  WeaponSE* wSE = new WeaponSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
600  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making WeaponSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
601  pSSE = wSE;
602  } break;
609  BatterySE* bSE = new BatterySE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
610  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making BatterySE for %s (%u)", entity.itemName.c_str(), entity.itemID);
611  pSSE = bSE;
612  } break;
623  ArraySE* aSE = new ArraySE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
624  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making ArraySE for %s (%u)", entity.itemName.c_str(), entity.itemID);
625  pSSE = aSE;
626  } break;
630  ReactorSE* rSE = new ReactorSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
631  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making ReactorSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
632  pSSE = rSE;
633  } break;
635  JumpBridgeSE* jbSE = new JumpBridgeSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
636  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making JumpBridgeSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
637  pSSE = jbSE;
638  } break;
639  default: {
640  StructureSE* sSE = new StructureSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
641  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making StructureSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
642  pSSE = sSE;
643  } break;
644  }
645  return pSSE;
646  } break;
647  case EVEDB::invCategories::SovereigntyStructure: {// SOV structures
648  //Create item ref
649  StructureItemRef structure = sItemFactory.GetStructure( entity.itemID );
650  if (structure.get() == nullptr)
651  return nullptr;
652  StructureSE* sSSE(nullptr);
653  //Test for different types of sov structures
654  switch(entity.groupID) {
656  TCUSE* sSE = new TCUSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
657  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making TCUSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
658  sSSE = sSE;
659  } break;
661  SBUSE* sSE = new SBUSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
662  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making SBUSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
663  sSSE = sSE;
664  } break;
666  IHubSE* sSE = new IHubSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
667  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making IHubSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
668  sSSE = sSE;
669  } break;
670  default: { //Should never be called, therefore print an error log
671  StructureSE* sSE = new StructureSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
672  _log(POS__ERROR, "DynamicEntityFactory::BuildEntity() Default sovereignty StructureSE created for %s (%u)", entity.itemName.c_str(), entity.itemID);
673  sSSE = sSE;
674  } break;
675  }
676  return sSSE;
677  } break;
678  case EVEDB::invCategories::Orbitals: { // planet orbitals these should go into m_staticEntities
679  StructureItemRef structure = sItemFactory.GetStructure( entity.itemID );
680  if (structure.get() == nullptr)
681  return nullptr;
683  CustomsSE* pCoSE(nullptr);
684  switch(entity.groupID) {
688  pCoSE = new CustomsSE(structure, *(sysMgr.GetServiceMgr()), &sysMgr, data);
689  //structure->GetMyInventory()->LoadContents(); this is called during structureItem creation
690  if ((entity.planetID) and (entity.groupID != EVEDB::invGroups::Test_Orbitals)) {
691  pCoSE->SetPlanet(entity.planetID);
692  SystemEntity* pPE = sysMgr.GetSE(entity.planetID);
693  if ((pPE != nullptr) and pPE->IsPlanetSE())
694  pPE->GetPlanetSE()->SetCustomsOffice(pCoSE);
695  }
696  pCoSE->Init();
697  _log(POS__TRACE, "DynamicEntityFactory::BuildEntity() making CustomsSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
698  } break;
699  }
700  return pCoSE;
701  } break;
703  // TODO: (just use CelestialEntity class for these until their own classes are written)
704  // * WarpGateEntity <-- Warp_Gate
705  // * WormholeEntity <-- Wormhole
706  switch (entity.groupID) {
708  WreckContainerRef wreck = sItemFactory.GetWreckContainer( entity.itemID );
709  if (wreck.get() == nullptr)
710  return nullptr;
712  WreckSE* wSE = new WreckSE(wreck, *(sysMgr.GetServiceMgr()), &sysMgr, data);
713  wreck->GetMyInventory()->LoadContents();
714  wreck->SetMySE(wSE);
715  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making WreckSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
716  return wSE;
717  } break;
723  CargoContainerRef contRef = sItemFactory.GetCargoContainer( entity.itemID );
724  if (contRef.get() == nullptr)
725  return nullptr;
727  ContainerSE* cSE = new ContainerSE(contRef, *(sysMgr.GetServiceMgr()), &sysMgr, data);
728  contRef->GetMyInventory()->LoadContents();
729  contRef->SetMySE(cSE);
730  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making ContainerSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
731  return cSE;
732  } break;
735  case EVEDB::invGroups::Ring:/*wtf*/
739  case EVEDB::invGroups::Large_Collidable_Ship: // this will not hit here. category 11, entity
744  /* test these to see if they are POS types */
749  case EVEDB::invGroups::Force_Field: // <<< this one is POS type but it IS a plain CSE
750  /* these will get their own class eventually */
756  CelestialObjectRef celestial = sItemFactory.GetCelestialObject( entity.itemID );
757  if (celestial.get() == nullptr)
758  return nullptr;
760  CelestialSE* cSE = new CelestialSE(celestial, *(sysMgr.GetServiceMgr()), &sysMgr);
761  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making CelestialSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
762  return cSE;
763  } break;
765  CelestialObjectRef celestial = sItemFactory.GetCelestialObject( entity.itemID );
766  if (celestial.get() == nullptr)
767  return nullptr;
769  WormholeSE* wSE = new WormholeSE(celestial, *(sysMgr.GetServiceMgr()), &sysMgr);
770  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making WormholeSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
771  return wSE;
772  } break;
775  CelestialObjectRef celestial = sItemFactory.GetCelestialObject( entity.itemID );
776  if (celestial.get() == nullptr)
777  return nullptr;
779  AnomalySE* aSE = new AnomalySE(celestial, *(sysMgr.GetServiceMgr()), &sysMgr);
780  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making AnomalySE for %s (%u)", entity.itemName.c_str(), entity.itemID);
781  return aSE;
782  } break;
783  case EVEDB::invGroups::Warp_Gate: { //accel gate
784  // does this need own item, or celestial, or generic or other?
785  InventoryItemRef iRef = sItemFactory.GetItem( entity.itemID );
786  //CelestialObjectRef celestial = sItemFactory.GetCelestialObject( entity.itemID );
787  if (iRef.get() == nullptr)
788  return nullptr;
790  ItemSystemEntity* iSE = new ItemSystemEntity(iRef, *(sysMgr.GetServiceMgr()), &sysMgr);
791  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making ISE for %s (%u)", entity.itemName.c_str(), entity.itemID);
792  return iSE;
793  } break;
794  } break;
795  } break;
796  case EVEDB::invCategories::Entity: { // Entities
797  if (entity.groupID == EVEDB::invGroups::Spawn_Container ) { // these are destructible objects found in dungeons
798  // For category=Entity, group=Spawn Container, create a CargoContainer object:
800  CargoContainerRef contRef = sItemFactory.GetCargoContainer( entity.itemID );
801  if (contRef.get() == nullptr)
802  return nullptr;
804  ContainerSE* cSE = new ContainerSE(contRef, *(sysMgr.GetServiceMgr()), &sysMgr, data);
805  contRef->GetMyInventory()->LoadContents();
806  contRef->SetMySE(cSE);
807  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making ContainerSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
808  return cSE;
810  or (entity.groupID == EVEDB::invGroups::Destructible_Sentry_Gun) or (entity.groupID == EVEDB::invGroups::Mobile_Sentry_Gun))
811  {
812  InventoryItemRef sentryRef = sItemFactory.GetItem( entity.itemID );
813  if (sentryRef.get() == nullptr)
814  return nullptr;
816  Sentry* SentrySE = new Sentry(sentryRef, *(sysMgr.GetServiceMgr()), &sysMgr, data);
817  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making SentrySE for %s (%u)", entity.itemName.c_str(), entity.itemID);
818  return SentrySE;
819  }
820  // Check for NPC ships/drones here (category 11): NOT player drones (different category [18])
821  else if((entity.groupID == EVEDB::invGroups::Police_Drone) or (entity.groupID == EVEDB::invGroups::Pirate_Drone) or (entity.groupID == EVEDB::invGroups::LCO_Drone)
822  or (entity.groupID == EVEDB::invGroups::Tutorial_Drone) or (entity.groupID == EVEDB::invGroups::Rogue_Drone) or (entity.groupID == EVEDB::invGroups::Faction_Drone)
823  or (entity.groupID == EVEDB::invGroups::Convoy) or (entity.groupID == EVEDB::invGroups::Convoy_Drone) or (entity.groupID == EVEDB::invGroups::Concord_Drone)
824  or (entity.groupID == EVEDB::invGroups::Mission_Drone) or (entity.groupID == EVEDB::invGroups::Deadspace_Overseer) or (entity.groupID == EVEDB::invGroups::Customs_Official)
825  or (entity.groupID == EVEDB::invGroups::Deadspace_Overseer_s_Structure) or (entity.groupID == EVEDB::invGroups::Deadspace_Overseer_s_Sentry)
826  or (entity.groupID == EVEDB::invGroups::Deadspace_Overseer_s_Belongings) or (entity.groupID == EVEDB::invGroups::Storyline_Frigate)
827  or (entity.groupID == EVEDB::invGroups::Storyline_Cruiser) or (entity.groupID == EVEDB::invGroups::Storyline_Battleship) or (entity.groupID == EVEDB::invGroups::Storyline_Mission_Frigate)
828  or (entity.groupID == EVEDB::invGroups::Storyline_Mission_Cruiser) or (entity.groupID == EVEDB::invGroups::Storyline_Mission_Battleship)
829  or ((entity.groupID >= EVEDB::invGroups::Asteroid_Angel_Cartel_Frigate) and (entity.groupID <= EVEDB::invGroups::Asteroid_Serpentis_BattleCruiser))
830  or ((entity.groupID >= EVEDB::invGroups::Deadspace_Angel_Cartel_BattleCruiser) and (entity.groupID <= EVEDB::invGroups::Deadspace_Angel_Cartel_Frigate))
831  or ((entity.groupID >= EVEDB::invGroups::Deadspace_Blood_Raiders_BattleCruiser) and (entity.groupID <= EVEDB::invGroups::Deadspace_Blood_Raiders_Frigate))
832  or ((entity.groupID >= EVEDB::invGroups::Deadspace_Guristas_BattleCruiser) and (entity.groupID <= EVEDB::invGroups::Deadspace_Guristas_Frigate))
834  or ((entity.groupID >= EVEDB::invGroups::Deadspace_Serpentis_BattleCruiser) and (entity.groupID <= EVEDB::invGroups::Deadspace_Serpentis_Frigate))
835  or ((entity.groupID >= EVEDB::invGroups::Mission_Amarr_Empire_Frigate) and (entity.groupID <= EVEDB::invGroups::Mission_Minmatar_Republic_Battleship))
836  or (entity.groupID == EVEDB::invGroups::Destructible_Agents_In_Space)
837  or ((entity.groupID >= EVEDB::invGroups::Asteroid_Rogue_Drone_Battlecruiser) and (entity.groupID <= EVEDB::invGroups::Asteroid_Rogue_Drone_Swarm))
838  or (entity.groupID == EVEDB::invGroups::Large_Collidable_Ship) // this is wreck? abandoned ship?
840  or ((entity.groupID >= EVEDB::invGroups::Mission_Generic_Battleships) and (entity.groupID <= EVEDB::invGroups::Mission_Generic_Destroyers))
842  or (entity.groupID == EVEDB::invGroups::Mission_Fighter_Drone)
843  or ((entity.groupID >= EVEDB::invGroups::Mission_Amarr_Empire_Carrier) and (entity.groupID <= EVEDB::invGroups::Mission_Minmatar_Republic_Carrier))
844  or (entity.groupID == EVEDB::invGroups::Mission_Faction_Transports) or (entity.groupID == EVEDB::invGroups::Mission_Faction_Industrials)
846  or (entity.groupID == EVEDB::invGroups::Deadspace_Sleeper_Emergent_Sentinel)
848  or (entity.groupID == EVEDB::invGroups::Mission_Faction_Cruiser) or (entity.groupID == EVEDB::invGroups::Mission_Faction_Frigate)
850  or (entity.groupID == EVEDB::invGroups::Incursion_Sanshas_Nation_Frigate) or (entity.groupID == EVEDB::invGroups::Incursion_Sanshas_Nation_Cruiser)
851  or (entity.groupID == EVEDB::invGroups::Incursion_Sanshas_Nation_Battleship))
852  {
853  InventoryItemRef npcRef = sItemFactory.GetItem( entity.itemID );
854  if (npcRef.get() == nullptr)
855  return nullptr;
857  NPC* npcSE = new NPC(npcRef, *(sysMgr.GetServiceMgr()), &sysMgr, data);
858  npcSE->Load();
859  sEntityList.AddNPC();
860  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making NPCSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
861  return npcSE;
862  }
863  // may have to create unique class for Billboard (EVEDB::invGroups::Billboard)
864  else {
865  InventoryItemRef iRef = sItemFactory.GetItem( entity.itemID );
866  if (iRef.get() == nullptr)
867  return nullptr;
869  ItemSystemEntity* cSE = new ItemSystemEntity(iRef, *(sysMgr.GetServiceMgr()), &sysMgr);
870  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making ISE item for %s (%u)", entity.itemName.c_str(), entity.itemID);
871  return cSE;
872  }
873  } break;
874  case EVEDB::invCategories::Drone: { // Player Drones
875  InventoryItemRef drone = sItemFactory.GetItem( entity.itemID );
876  if (drone.get() == nullptr)
877  return nullptr;
879  DroneSE* dSE = new DroneSE(drone, *(sysMgr.GetServiceMgr()), &sysMgr, data);
880  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making DroneSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
881  return dSE;
882  } break;
884  switch (entity.groupID) {
886  ProbeItemRef pRef = sItemFactory.GetProbeItem(entity.itemID);
887  if (pRef.get() == nullptr)
888  return nullptr;
890  // make sure these are owned by eve system
891  pRef->ChangeOwner(1);
892  //these probes are abandoned and offline. give them 5h lifetime
893  ProbeSE* pSE = new ProbeSE(pRef, *(sysMgr.GetServiceMgr()), &sysMgr);
894  _log(ITEM__TRACE, "DynamicEntityFactory::BuildEntity() making ProbeSE for %s (%u)", entity.itemName.c_str(), entity.itemID);
895  return pSE;
896  } break;
898  sLog.Warning("BuildEntity", "Called for Survey_Probe");
899  } break;
901  sLog.Warning("BuildEntity", "Called for Warp_Disruption_Probe");
902  } break;
903  }
904  } break;
905  }
906  sLog.Warning("BuildEntity", "Unhandled dynamic entity category %u for item %u of type %u", entity.categoryID, entity.itemID, entity.typeID);
907  EvE::traceStack();
908  return nullptr;
909 }
Definition: IHub.h:15
#define _log(type, fmt,...)
Definition: logsys.h:124
Definition: SBU.h:15
virtual bool Load()
Definition: NPC.cpp:86
virtual PlanetSE * GetPlanetSE()
Definition: SystemEntity.h:101
void SetCustomsOffice(CustomsSE *pSE)
Definition: Planet.h:67
#define sEntityList
Definition: EntityList.h:208
Definition: Sentry.h:20
Definition: Ship.h:301
virtual bool IsPlanetSE()
Definition: SystemEntity.h:149
const ItemType & type() const
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Definition: Probes.h:71
virtual SystemEntity * GetSE()
Definition: SystemEntity.h:97
void SetAttribute(uint16 attrID, int num, bool notify=true)
Definition: Array.h:18
X * get() const
Definition: RefPtr.h:213
Definition: NPC.h:41
Definition: Drone.h:46
itemID[count] Create count or of the specified() x() entityID Translocate to the specified entity Immediately stops ship
uint32 corporationID
bool LoadContents()
Definition: Inventory.cpp:113
Definition: TCU.h:15
void traceStack(void)
Definition: misc.cpp:169
float radius() const
Definition: ItemType.h:68
Definition: Tower.h:19
#define sItemFactory
Definition: ItemFactory.h:165
void SetMySE(SystemEntity *pSE)
Definition: Container.h:93
void SetMySE(SystemEntity *pSE)
Definition: Container.h:208
Inventory * GetMyInventory()
Definition: InventoryItem.h:91

Here is the call graph for this function:

Here is the caller graph for this function:


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