PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
InventoryLocation Class Reference

InventoryLocation. More...

Private Member Functions

proto native bool IsValid ()
 verify current set inventory location
 
proto native int GetType ()
 returns type of InventoryLocation
 
proto native EntityAI GetParent ()
 returns parent of current inventory location
 
proto native EntityAI GetItem ()
 returns item of current inventory location
 
proto native int GetSlot ()
 returns slot id if current type is Attachment
 
proto native int GetIdx ()
 returns index of cargo if current type is Cargo / ProxyCargo
 
proto native int GetRow ()
 returns row of cargo if current type is Cargo / ProxyCargo
 
proto native int GetCol ()
 returns column of cargo if current type is Cargo / ProxyCargo
 
proto native bool GetFlip ()
 returns flip status of cargo
 
proto native vector GetPos ()
 returns position of item in world if type is Ground
 
proto native void GetDir (out float dir[4])
 returns direction of item in world if type is Ground
 
proto native void SetGround (EntityAI e, vector mat[4])
 sets current inventory location type to Ground with transformation mat
 
proto native void SetGroundEx (EntityAI e, vector pos, float dir[4])
 sets current inventory location type to Ground with transformation mat
 
proto native void SetAttachment (notnull EntityAI parent, EntityAI e, int slotId)
 sets current inventory location type to Attachment with slot id set to <slotId>
 
proto native void SetCargoAuto (notnull CargoBase cargo, EntityAI e, int row, int col, bool flip)
 based on Cargo.IsProxyCargo uses SetProxyCargo or SetCargo respectively
 
proto native void SetCargo (notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
 sets current inventory location type to Cargo with coordinates (idx, row, col)
 
proto native void SetProxyCargo (notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
 sets current inventory location type to ProxyCargo with coordinates (idx, row, col) @NOTE: typical usage is in building-like dummy structures, where furniture with cargo is part of the model, and is not a physical entity (like person or bag).
 
proto native void SetHands (notnull EntityAI parent, EntityAI e)
 sets current inventory location type to Hands
 
proto native void SetVehicle (notnull EntityAI parent, EntityAI e, int idx)
 
proto native void SetParent (notnull EntityAI parent)
 
proto native void SetItem (notnull EntityAI item)
 
proto native void SetSlot (int slotId)
 
proto native void SetIndex (int idx)
 
proto native void SetRow (int row)
 
proto native void SetCol (int col)
 
proto native void SetFlip (bool flip)
 
proto native void Reset ()
 
proto native bool CompareLocationOnly (notnull InventoryLocation other)
 
proto native bool CollidesWith (notnull InventoryLocation rhs)
 checks if inventory locations collides each with other
 
proto native InventoryLocation Copy (notnull InventoryLocation rhs)
 copies location data to another location
 
proto native InventoryLocation CopyLocationFrom (notnull InventoryLocation rhs, bool copyFlip)
 copies location to another location without m_item member
 
string DumpToString ()
 
bool ReadFromContext (ParamsReadContext ctx)
 
bool WriteToContext (ParamsWriteContext ctx)
 

Static Private Member Functions

static string DumpToStringNullSafe (InventoryLocation loc)
 

Detailed Description

Member Function Documentation

◆ CollidesWith()

CollidesWith ( notnull InventoryLocation  rhs)
private

checks if inventory locations collides each with other

◆ CompareLocationOnly()

proto native bool CompareLocationOnly ( notnull InventoryLocation  other)
private

◆ Copy()

Copy ( notnull InventoryLocation  rhs)
private

copies location data to another location

@NOTE it copies all data (except enforce internal data)

Referenced by InventoryItem::EEItemLocationChanged(), HumanInventory::OnEntityInHandsCreated(), HumanInventory::OnEntityInHandsDestroyed(), SlotToAnimType(), TransferInventory(), and ValidateHandEvent().

◆ CopyLocationFrom()

CopyLocationFrom ( notnull InventoryLocation  rhs,
bool  copyFlip 
)
private

copies location to another location without m_item member

@NOTE it does NOT do a copy of m_item member!

Referenced by ManBase::OnQuickBarSingleUse(), and ReplaceItemWithNewLambdaBase::PrepareLocations().

◆ DumpToString()

◆ DumpToStringNullSafe()

static string DumpToStringNullSafe ( InventoryLocation  loc)
inlinestaticprivate

◆ GetCol()

GetCol ( )
private

returns column of cargo if current type is Cargo / ProxyCargo

Returns
index or -1

Referenced by Container::AddedToCargoEx(), GameInventory::CreateInInventory(), DumpToString(), Container::MovedInCargo(), InventoryItem::OnRightClick(), Container::SetLock(), and WriteToContext().

◆ GetDir()

GetDir ( out float  dir[4])
private

returns direction of item in world if type is Ground

Returns
position

Referenced by DropNonUsableMaterialsServer(), DumpToString(), ReplaceItemWithNewLambdaBase::PrepareLocations(), and WriteToContext().

◆ GetFlip()

◆ GetIdx()

GetIdx ( )
private

returns index of cargo if current type is Cargo / ProxyCargo

Returns
index or -1

Referenced by GameInventory::CreateInInventory(), DumpToString(), IsItemInCargoOfSomething(), InventoryItem::OnRightClick(), PumpkinHelmet::UpdateGlowState(), and WriteToContext().

◆ GetItem()

◆ GetParent()

◆ GetPos()

◆ GetRow()

GetRow ( )
private

◆ GetSlot()

GetSlot ( )
private

returns slot id if current type is Attachment

@NOTE: slot id is related to order of entries in DZ/data/config.cpp secton CfgSlots

Returns
slot id if attachment, -1 otherwise

Referenced by ActionLockAttachment::ActionCondition(), ActionRefuelTorch::ActionCondition(), ActionRepairCarPart::ActionCondition(), ActionAttachToConstruction::ActionCondition(), AttachmentCategoriesRow::CanCombine(), InventoryItemSuper::CanDetachAttachment(), LayoutHolder::CanEquipEx(), GameInventory::CanForceSwapEntitiesEx(), Entity::CanReleaseAttachment(), Car::CanReleaseAttachment(), GameInventory::CanSwapEntitiesEx(), ManBase::CheckAndExecuteStackSplitToInventoryLocation(), Entity::CheckAttachmentReceiveExclusion(), Entity::ClearExclusionValueRecursive(), AttachmentCategoriesRow::Combine(), GameInventory::CreateInInventory(), ReplaceItemWithNewLambdaBase::CreateNewEntity(), DestroyMaterialsServer(), ZombieContainer::DoubleClick(), DropNonUsableMaterialsServer(), DumpToString(), InventoryItem::EEDelete(), InventoryItem::EEItemLocationChanged(), ItemManager::GetCombinationFlags(), GameInventory::GetCurrentAttachmentSlotInfo(), InventoryItem::GetQuantityMax(), ItemBase::GetSlotLockedState(), ItemBase::IsAttachmentSlotLocked(), Entity::IsExclusionFlagPresentRecursive(), Entity::IsLockedInSlot(), Entity::IsSlotReserved(), ItemBase::LockAttachmentSlot(), LockServer(), InventoryItem::LockToParent(), Icon::MouseClick(), Container::MoveContainerDown(), Container::MoveContainerUp(), AttachmentCategoriesRow::OnDropReceivedFromHeader(), BotStateBase::OnEntry(), WeaponStateBase::OnEntry(), ActionTakeArrow::OnExecute(), ActionTakeHybridAttachment::OnExecute(), ActionTakeItem::OnExecute(), ActionRemoveSeed::OnExecuteClient(), ActionAttachPowerSourceToPanel::OnExecuteImpl(), OnFinishProgressServer(), BotStateBase::OnUpdate(), Entity::PropagateExclusionValueRecursive(), HumanInventory::RedirectToHandEvent(), Attachments::Select(), AttachmentCategoriesRow::Select(), SetLockOnAttachedMaterials(), SetupAction(), SlotToAnimType(), StaticConstructionMethods::SpawnConstructionMaterialPiles(), PluginBase::SpawnEntityInPlayerInventory(), HumanInventory::SwappingToPreviousLocation(), ClosableContainer::TakeAsAttachment(), EntityAI::TakeEntityToTargetAttachmentImpl(), TakeMaterialsServer(), SplitItemUtils::TakeOrSplitToInventory(), PlayerContainer::ToggleContainer(), InventoryItem::UnlockFromParent(), UnlockServer(), ItemBase::UpdateAttachmentSlot(), UpdateConsoleToolbar(), PumpkinHelmet::UpdateGlowState(), EntityLightSource::UpdateMode(), WriteToContext(), and InventoryItem::~ItemBase().

◆ GetType()

GetType ( )
private

returns type of InventoryLocation

See also
InventoryLocationType for known types of inventory locations

Referenced by ActionTurnOffWhileOnGround::ActionCondition(), ActionTurnOnWhileOnGround::ActionCondition(), Entity::AreChildrenAccessible(), ItemBase::CanLoadAttachment(), HandEventBase::CanPerformEvent(), CarWheel_Ruined::CanPutAsAttachment(), ImprovisedExplosive::CanReceiveAttachment(), Plastic_Explosive::CanReceiveAttachment(), ItemBase::CanReceiveAttachment(), Entity::CheckAttachmentReceiveExclusion(), GameInventory::CreateInInventory(), ReplaceItemWithNewLambdaBase::CreateNewEntity(), ItemBase::CreateRope(), Icon::DoubleClick(), DraggingOverCenterPanel(), HumanInventory::DropEntity(), DumpToString(), InventoryItem::EEDelete(), GameInventory::EEInit(), InventoryItem::EEItemLocationChanged(), ItemBase::EEKilled(), HumanInventory::ForceSwapEntities(), GameInventory::GetCurrentAttachmentSlotInfo(), InventoryItem::GetDebugActions(), ActionTargetsCursor::GetTarget(), Entity::GetViewIndex(), ItemBase::GetViewIndex(), HandGuardBase::GuardCondition(), GameInventory::IsAttachment(), GameInventory::IsCargoInHiearchy(), GameInventory::IsInCargo(), ItemBase::IsPlaceable(), Weapon::IsRemoteWeapon(), ManBase::IsSwapBetweenHandsAndGroundLargeItem(), HumanInventory::LocalDestroyEntity(), GameInventory::LocalDestroyEntity(), OnCenterPanelDropReceived(), VicinityContainer::OnDropReceivedFromIcon(), OnEndClient(), WeaponStateBase::OnEntry(), OnItemLocationChanged(), ActionDeployBase::OnUpdate(), BotStateBase::OnUpdate(), ManBase::PredictiveForceSwapEntities(), ReplaceItemWithNewLambdaBase::PrepareLocations(), HumanInventory::RedirectToHandEvent(), HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl(), HumanInventory::ReplaceItemInHandsWithNewImpl(), ItemManager::ShowSourceDropzone(), SlotToAnimType(), InventoryItem::SplitItem(), HumanInventory::SwapEntities(), HumanInventory::SwappingToPreviousLocation(), HumanInventory::TakeEntityAsAttachmentEx(), HumanInventory::TakeEntityToCargoEx(), SplitItemUtils::TakeOrSplitToInventory(), HumanInventory::ThrowEntity(), UpdateConsoleToolbar(), ManBase::UpdateDelete(), EntityLightSource::UpdateMode(), Edible_Base::UpdateVaporParticle(), WriteToContext(), and InventoryItem::~ItemBase().

◆ IsValid()

◆ ReadFromContext()

◆ Reset()

Reset ( )
private

◆ SetAttachment()

◆ SetCargo()

SetCargo ( notnull EntityAI  parent,
EntityAI  e,
int  idx,
int  row,
int  col,
bool  flip 
)
private

sets current inventory location type to Cargo with coordinates (idx, row, col)

Parameters
[in]parentparent entity that will receive item <e> into cargo
[in]eentity with this inventory location (null for new spawns)
[in]idxindex of cargo
[in]rowrow of the cargo
[in]colcolumn of the cargo

Referenced by InventoryItem::OnRightClick(), ReplaceWithNewReciveCargoLambda::OnSuccess(), ReadFromContext(), HumanInventory::TakeEntityToCargoEx(), and GameInventory::TakeEntityToCargoEx().

◆ SetCargoAuto()

SetCargoAuto ( notnull CargoBase  cargo,
EntityAI  e,
int  row,
int  col,
bool  flip 
)
private

based on Cargo.IsProxyCargo uses SetProxyCargo or SetCargo respectively

Parameters
[in]cargocargo that will receive item <e> into cargo
[in]eentity with this inventory location (null for new spawns)
[in]rowrow of the cargo
[in]colcolumn of the cargo

Referenced by Icon::DraggingOver(), ClosableContainer::DraggingOverGrid(), ClosableContainer::DropReceived(), HandsContainer::DropReceived(), AttachmentCategoriesRow::DropReceived(), ClosableContainer::DropReceived(), Icon::DropReceivedFromMain(), ManBase::PredictiveTakeEntityToTargetCargoEx(), and GameInventory::TakeEntityToTargetCargoEx().

◆ SetCol()

proto native void SetCol ( int  col)
private

◆ SetFlip()

proto native void SetFlip ( bool  flip)
private

◆ SetGround()

◆ SetGroundEx()

SetGroundEx ( EntityAI  e,
vector  pos,
float  dir[4] 
)
private

sets current inventory location type to Ground with transformation mat

Parameters
[in]eentity with this inventory location (null for new spawns)
[in]posposition vector
[in]dirdirection quat

Referenced by ActionRepackTentCB::DropDuringRepacking(), DropNonUsableMaterialsServer(), ActionDeployBase::MoveEntityToFinalPosition(), ItemBase::OnPlacementComplete(), ReplaceItemWithNewLambdaBase::PrepareLocations(), ReadFromContext(), and ThrowEntityFromInventory().

◆ SetHands()

◆ SetIndex()

proto native void SetIndex ( int  idx)
private

◆ SetItem()

SetItem ( notnull EntityAI  item)
private

brief sets current inventory location's item

Referenced by WeaponStateBase::OnEntry().

◆ SetParent()

SetParent ( notnull EntityAI  parent)
private

brief sets current inventory location's GetParent

Referenced by TransferInventory().

◆ SetProxyCargo()

SetProxyCargo ( notnull EntityAI  parent,
EntityAI  e,
int  idx,
int  row,
int  col,
bool  flip 
)
private

sets current inventory location type to ProxyCargo with coordinates (idx, row, col) @NOTE: typical usage is in building-like dummy structures, where furniture with cargo is part of the model, and is not a physical entity (like person or bag).

Parameters
[in]parentparent entity that will receive item <e> into proxy cargo
[in]eentity with this inventory location (null for new spawns)
[in]idxindex of cargo
[in]rowrow of the cargo
[in]colcolumn of the cargo

Referenced by ReadFromContext().

◆ SetRow()

proto native void SetRow ( int  row)
private

◆ SetSlot()

proto native void SetSlot ( int  slotId)
private

◆ SetVehicle()

SetVehicle ( notnull EntityAI  parent,
EntityAI  e,
int  idx 
)
private

brief sets current inventory location's GetParent

Parameters
[in]idxindex of seat

Referenced by ActionGetInTransport::AddActionJuncture(), ActionAnimateSeats::AddActionJuncture(), ActionSwitchSeats::AddActionJuncture(), and ReadFromContext().

◆ WriteToContext()


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