67 if (
sConfig.debug.DeleteTrackingCans)
80 sLog.Blue(
" ItemFactory",
"Item Factory Initialized.");
86 sLog.Warning(
" ItemFactory",
"%u Items, %u Types still in list", \
101 if (
sConfig.debug.DeleteTrackingCans)
105 std::vector<Inv::SaveData>
items;
109 cur.second->SaveAttributes();
113 data.
flag = cur.second->flag();
115 data.
ownerID = cur.second->ownerID();
116 data.
position = cur.second->position();
117 data.
quantity = cur.second->quantity();
118 data.
singleton = cur.second->isSingleton();
119 data.
typeID = cur.second->typeID();
121 items.push_back(data);
126 sLog.Warning(
" SaveItems",
"Saved %u Dynamic Items in %.3fms.", count, (
GetTimeMSeconds() -startTime));
135 sLog.Warning(
"ItemFactory::AddItem()",
"Trying to Add invalid UID %u for %s", iRef->itemID(), iRef->name());
138 m_items.emplace(iRef->itemID(), iRef);
177 std::map<uint32, InventoryItemRef>::iterator itr =
m_items.find(itemID);
184 if (iRef.
get() ==
nullptr)
187 return iRef->GetMyInventory();
192 std::map<uint32, InventoryItemRef>::iterator itr =
m_items.find(itemID);
205 std::map<uint32, InventoryItemRef>::iterator itr =
m_items.find(itemID);
208 itr =
m_items.find(iRef->locationID());
215 itr =
m_items.find(iRef->locationID());
220 if (iRef.
get() ==
nullptr)
229 std::map<uint32, InventoryItemRef>::iterator itr =
m_items.find(itemID);
232 itr =
m_items.find(iRef->locationID());
239 itr =
m_items.find(iRef->locationID());
244 if (iRef.
get() ==
nullptr)
247 return iRef->GetMyInventory();
252 std::map<uint16, ItemType*>::iterator itr =
m_types.find(typeID);
254 _Ty* type = _Ty::Load(typeID);
259 itr =
m_types.insert(std::make_pair(typeID, type)).first;
261 return static_cast<const _Ty *
>(itr->second);
265 return _GetType<ItemType>(typeID);
269 return _GetType<BlueprintType>(blueprintTypeID);
273 return _GetType<CharacterType>(characterTypeID);
284 return _GetType<StationType>(stationTypeID);
290 std::map<uint32, InventoryItemRef>::iterator itr =
m_items.find(itemID);
293 _log(ITEM__WARNING,
"ItemFactory::_GetItem() called on invalid Item %u", itemID);
305 itr =
m_items.insert(std::make_pair(itemID, item)).first;
313 return _GetItem<InventoryItem>(
itemID);
318 return _GetItem<Blueprint>(blueprintID);
323 return _GetItem<Character>(characterID);
328 return _GetItem<ShipItem>(shipID);
333 return _GetItem<CelestialObject>(celestialID);
338 return _GetItem<SolarSystem>(solarSystemID);
343 return _GetItem<StationItem>(stationID);
348 return _GetItem<Skill>(
skillID);
353 return _GetItem<AsteroidItem>(asteroidID);
358 return _GetItem<StationOffice>(officeID);
363 return _GetItem<StructureItem>(structureID);
368 return _GetItem<CargoContainer>(containerID);
373 return _GetItem<WreckContainer>(containerID);
378 return _GetItem<ModuleItem>(moduleID);
382 return _GetItem<ProbeItem>(probeID);
389 if (iRef.
get() !=
nullptr)
407 if (iRef.
get() !=
nullptr)
416 if (iRef.
get() !=
nullptr)
425 if (iRef.
get() !=
nullptr)
434 if (iRef.
get() !=
nullptr)
443 if (iRef.
get() !=
nullptr)
452 if (iRef.
get() !=
nullptr)
461 if (iRef.
get() !=
nullptr)
470 if (iRef.
get() !=
nullptr)
479 if (iRef.
get() !=
nullptr)
InventoryItemRef GetItem(uint32 itemID)
#define sConfig
A macro for easier access to the singleton.
ProbeItemRef GetProbeItem(uint32 probeID)
static ShipItemRef Spawn(ItemData &data)
Inventory * GetInventoryFromId(uint32 itemID, bool load=true)
const ItemType * GetType(uint16 typeID)
static bool GetCharacterTypeByBloodline(uint8 bloodlineID, uint16 &characterTypeID)
StationItemRef GetStationItem(uint32 stationID)
const StationType * GetStationType(uint16 stationTypeID)
#define _log(type, fmt,...)
AsteroidItemRef SpawnAsteroid(ItemData &idata, AsteroidData &adata)
static AsteroidItemRef Spawn(ItemData &idata, AsteroidData &adata)
InventoryItemRef SpawnTempItem(ItemData &data)
void RemoveItem(uint32 itemID)
SkillRef GetSkill(uint32 skillID)
const CharacterType * GetCharacterType(uint16 characterTypeID)
const CharacterType * GetCharacterTypeByBloodline(uint16 bloodlineID)
static void SaveItems(std::vector< Inv::SaveData > &data)
std::map< uint16, ItemType * > m_types
CharacterRef GetCharacter(uint32 characterID)
static CharacterRef Spawn(CharacterData &charData, CorpData &corpData)
static void DeleteSpawnedRats()
SolarSystemRef GetSolarSystem(uint32 solarSystemID)
static SkillRef Spawn(ItemData &data)
CharacterRef SpawnCharacter(CharacterData &charData, CorpData &corpData)
SkillRef SpawnSkill(ItemData &data)
itemID[count] Create count or of the specified item(from Insider)" ) COMMAND( goto
CelestialObjectRef GetCelestialObject(uint32 celestialID)
uint32 GetNextMissileID()
StationOfficeRef GetOffice(uint32 officeID)
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
static ModuleItemRef Spawn(ItemData &data)
#define sLog
Evaluates to a NewLog instance.
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()()() itemID() itemID Fits selected item to active ship() skillID(level)-gives skillID to specified level." ) COMMAND( online
InventoryItemRef SpawnItem(ItemData &data)
WreckContainerRef SpawnWreckContainer(ItemData &data)
#define IsPlayerItem(itemID)
std::map< uint32, InventoryItemRef > m_items
AsteroidItemRef GetAsteroid(uint32 asteroidID)
static InventoryItemRef SpawnTemp(ItemData &data)
static void DeleteTrackingCans()
const _Ty * _GetType(uint16 typeID)
static CargoContainerRef Spawn(ItemData &data)
const BlueprintType * GetBlueprintType(uint16 blueprintTypeID)
StationOfficeRef SpawnOffice(ItemData &idata, OfficeData &odata)
static WreckContainerRef Spawn(ItemData &data)
CargoContainerRef GetCargoContainer(uint32 containerID)
static ProbeItemRef Spawn(ItemData &data)
static InventoryItemRef Spawn(ItemData &data)
StructureItemRef GetStructure(uint32 structureID)
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
ProbeItemRef SpawnProbe(ItemData &data)
ShipItemRef GetShip(uint32 shipID)
RefPtr< InventoryItem > InventoryItemRef
#define IsTempItem(itemID)
ModuleItemRef GetModuleItem(uint32 moduleID)
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()() itemID(attributeID)-Retrieves attribute value." ) COMMAND( setattr
ModuleItemRef SpawnModule(ItemData &data)
static StationOfficeRef Spawn(ItemData &idata, OfficeData &odata)
void AddItem(InventoryItemRef iRef)
RefPtr< _Ty > _GetItem(uint32 itemID)
CargoContainerRef SpawnCargoContainer(ItemData &data)
Inventory * GetItemContainerInventory(uint32 itemID, bool load=true)
InventoryItemRef GetItemContainer(uint32 itemID, bool load=true)
BlueprintRef GetBlueprint(uint32 blueprintID)
InventoryItemRef GetInventoryItemFromID(uint32 itemID, bool load=true)
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all items
static StructureItemRef Spawn(ItemData &data)
WreckContainerRef GetWreckContainer(uint32 containerID)
#define IsValidLocation(itemID)
StructureItemRef SpawnStructure(ItemData &data)
ShipItemRef SpawnShip(ItemData &data)
Reference-counting-based smart pointer.