script counterpart to engine's class Inventory More...
Private Member Functions | |
proto native bool | GetCurrentInventoryLocation (out notnull InventoryLocation loc) |
returns information about current item location | |
proto native bool | FindFreeLocationFor (notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc) |
FindFreeLocationFor. | |
proto native bool | FindFreeLocationForEx (notnull EntityAI item, FindInventoryLocationType flags, notnull InventoryLocation exclude, out notnull InventoryLocation loc) |
FindFreeLocationForEx. | |
proto native bool | FindFirstFreeLocationForNewEntity (string item_type, FindInventoryLocationType flags, out notnull InventoryLocation loc) |
FindFirstFreeLocationForNewEntity. | |
proto native int | FindFreeLocationsFor (notnull EntityAI item, FindInventoryLocationType flags, out notnull array< ref InventoryLocation > locs) |
searches inventory for suitable location for @item | |
bool | IsInCargo () |
Returns true if this Inventory owner is in cargo of something. | |
bool | IsAttachment () |
Returns true if this Inventory owner is an attachment of something. | |
bool | IsCargoInHiearchy () |
Returns true if inventory owner or his hiearchy parents are in cargo. | |
bool | AreChildrenAccessible () |
Returns true if item is considered reachable within inventory. | |
bool | GetCurrentAttachmentSlotInfo (out int slot_id, out string slot_name) |
Returns true if the item is currently attached and outputs attachment slot id and name. | |
proto native bool | CanAddSwappedEntity (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2) |
void | OnInventoryFailure (InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst) |
bool | TakeEntityToInventory (InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item) |
Put item anywhere into this entity (as attachment or into cargo, recursively) | |
bool | TakeEntityToTargetInventory (InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item) |
helper that finds location first, then moves the entity into it | |
bool | TakeToDst (InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst) |
move src to dst | |
bool | TakeEntityToCargo (InventoryMode mode, notnull EntityAI item) |
moves item to cargo of this intentory | |
bool | TakeEntityToTargetCargo (InventoryMode mode, notnull EntityAI target, notnull EntityAI item) |
Put item into into cargo of another entity. | |
bool | TakeEntityToCargoEx (InventoryMode mode, notnull EntityAI item, int idx, int row, int col) |
moves item on specific cargo location | |
bool | TakeEntityToTargetCargoEx (InventoryMode mode, notnull CargoBase cargo, notnull EntityAI item, int row, int col) |
Put item into into cargo on specific cargo location of another entity. | |
bool | TakeEntityAsAttachmentEx (InventoryMode mode, notnull EntityAI item, int slot) |
bool | TakeEntityAsTargetAttachmentEx (InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot) |
put item as attachment of target | |
bool | TakeEntityAsAttachment (InventoryMode mode, notnull EntityAI item) |
bool | TakeEntityAsTargetAttachment (InventoryMode mode, notnull EntityAI target, notnull EntityAI item) |
bool | SwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2) |
bool | ForceSwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst) |
bool | DropEntity (InventoryMode mode, EntityAI owner, notnull EntityAI item) |
bool | DropEntityWithTransform (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector transform[4]) |
bool | DropEntityInBounds (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector halfExtents, float angle, float cosAngle, float sinAngle) |
bool | LocalDestroyEntity (notnull EntityAI item) |
bool | ReplaceItemWithNew (InventoryMode mode, ReplaceItemWithNewLambdaBase lambda) |
proto native bool | GetFlipCargo () |
proto native void | SetFlipCargo (bool flip) |
proto native void | FlipCargo () |
proto native void | ResetFlipCargo () |
proto native EntityAI | GetInventoryOwner () |
Engine native functions. | |
proto native bool | HasEntityInInventory (notnull EntityAI item) |
query inventory if item is somewhere | |
proto native bool | EnumerateInventory (InventoryTraversalType tt, out array< EntityAI > items) |
enumerate inventory using traversal type and filling items array | |
proto native int | CountInventory () |
almost identical to EnumerateInventory except it does not return items | |
proto native CargoBase | GetCargo () |
cargo | |
proto native CargoBase | GetCargoFromIndex (int index) |
proto native EntityAI | CreateEntityInCargo (string typeName) |
Create Entity of specified type in cargo of entity. | |
proto native EntityAI | CreateEntityInCargoEx (string typeName, int idx, int row, int col, bool flip) |
Create Entity of specified type in cargo of entity at coordinates (row, col) | |
proto native bool | HasEntityInCargo (notnull EntityAI e) |
proto native bool | HasEntityInCargoEx (notnull EntityAI e, int idx, int row, int col) |
proto native bool | CanAddEntityInCargo (notnull EntityAI e, bool flip) |
proto native bool | CanAddEntityInCargoEx (notnull EntityAI e, int idx, int row, int col, bool flip) |
proto native bool | CanAddEntityInCargoExLoc (InventoryLocation loc) |
proto native bool | TestAddEntityInCargoEx (notnull EntityAI e, int idx, int row, int col, bool flip, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check) |
proto native bool | TestAddEntityInCargoExLoc (notnull InventoryLocation loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check) |
proto native bool | CanRemoveEntityInCargo (notnull EntityAI e) |
proto native bool | CanRemoveEntityInCargoEx (notnull EntityAI e, int idx, int row, int col) |
proto native int | GetSlotId (int index) |
attachments | |
proto native int | GetSlotIdCount () |
proto native int | GetAttachmentSlotId (int index) |
proto native int | GetAttachmentSlotsCount () |
bool | HasAttachmentSlot (int slotId) |
proto native bool | HasInventorySlot (int slotId) |
proto native int | AttachmentCount () |
Returns count of attachments attached to this item. | |
proto native EntityAI | CreateAttachment (string typeName) |
Create Entity of specified type as attachment of entity. | |
proto native EntityAI | CreateAttachmentEx (string typeName, int slotId) |
Create Entity of specified type as attachment of entity. | |
proto native EntityAI | GetAttachmentFromIndex (int index) |
proto native EntityAI | FindAttachment (int slot) |
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id) | |
proto native EntityAI | FindAttachmentByName (string slotName) |
Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id) | |
proto native bool | HasAttachment (notnull EntityAI e) |
brief Returns True if entity is attached to this | |
proto native bool | HasAttachmentEx (notnull EntityAI e, int slot) |
brief Returns True if entity is attached to this in slot | |
proto native bool | CanAddAttachment (notnull EntityAI e) |
Check if attachment can be added to any slot. | |
proto native bool | CanAddAttachmentEx (notnull EntityAI e, int slot) |
Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp. | |
proto native bool | CanRemoveAttachment (EntityAI attachment) |
proto native bool | CanRemoveAttachmentEx (EntityAI attachment, int slot) |
proto native EntityAI | FindPlaceholderForSlot (int slot) |
Returns placeholder entity for slot (naked arms, legs etc) | |
proto native bool | IsPlaceholderEntity (notnull Object e) |
proto native bool | CanLockInventoryWithKey (notnull EntityAI key) |
locks | |
proto native bool | CanUnlockInventoryWithKey (notnull EntityAI key) |
proto native void | LockInventoryWithKey (notnull EntityAI key) |
proto native void | UnlockInventoryWithKey (notnull EntityAI key) |
proto native bool | HasKeys () |
proto native void | LockInventory (int lockType) |
proto native void | UnlockInventory (int lockType) |
proto native int | GetScriptLockCount () |
proto native bool | IsInventoryUnlocked () |
proto native bool | IsInventoryLocked () |
proto native bool | IsInventoryLockedForLockType (int lockType) |
proto native bool | SetSlotLock (int slot, bool locked) |
proto native bool | GetSlotLock (int slot) |
void | Init () |
script functions | |
bool | OnStoreLoad (ParamsReadContext ctx, int version) |
db load hooks | |
void | OnAfterStoreLoad () |
void | OnStoreSave (ParamsWriteContext ctx) |
db store hook | |
void | EEInit () |
void | EEDelete (EntityAI parent) |
EntityAI | CreateInInventory (string type) |
creates entity somewhere in inventory | |
bool | CanAddEntityToInventory (notnull EntityAI item, int flag=FindInventoryLocationType.ANY) |
ask inventory if item could be placed somewhere in inventory | |
bool | AddEntityToInventory (notnull EntityAI item) |
add entity somewhere in inventory | |
bool | CanRemoveEntity () |
Returns if entity can be removed from its current location. | |
bool | CanAddEntityInto (notnull EntityAI item, FindInventoryLocationType flags=FindInventoryLocationType.ANY) |
Asks inventory if item could be placed in inventory, hands, etc. | |
bool | CanAddEntityIntoInventory (notnull EntityAI item) |
Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment) | |
bool | CanAddEntityIntoHands (notnull EntityAI item) |
Test if entity can be put into hands. | |
bool | OnInputUserDataProcess (ParamsReadContext ctx) |
synchronization | |
bool | OnInventoryJunctureFromServer (ParamsReadContext ctx) |
bool | OnInventoryJunctureRepairFromServer (ParamsReadContext ctx) |
void | OnInventoryJunctureFailureFromServer (ParamsReadContext ctx) |
void | OnServerInventoryCommand (ParamsReadContext ctx) |
Static Private Member Functions | |
static proto native EntityAI | LocationCreateEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation) |
creates new item directly at location | |
static proto native EntityAI | LocationCreateLocalEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation) |
creates new local item directly at location @NOTE: the item is created localy, i.e. it's not registered to network | |
static proto native bool | LocationCanAddEntity (notnull InventoryLocation inv_loc) |
queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/... | |
static bool | LocationCanAddEntityEx (notnull InventoryLocation inv_loc) |
static proto native bool | LocationTestAddEntity (notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check) |
test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/... | |
static proto native bool | LocationCanRemoveEntity (notnull InventoryLocation inv_loc) |
queries if the entity contained in inv_loc.m_item can be removed from ground/attachment/cargo/hands/... | |
static proto native bool | LocationCanMoveEntity (notnull InventoryLocation src, notnull InventoryLocation dst) |
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthand for CanRemove + CanAdd query | |
static int | GetInventoryCheckContext () |
static bool | LocationCanMoveEntitySyncCheck (notnull InventoryLocation src, notnull InventoryLocation dst) |
static proto native EntityAI | LocationGetEntity (notnull InventoryLocation inv_loc) |
static void | OnServerInventoryCommandStatic (ParamsReadContext ctx) |
static proto native bool | LocationAddEntity (notnull InventoryLocation inv_loc) |
adds item to inventory location | |
static proto native bool | LocationRemoveEntity (notnull InventoryLocation inv_loc) |
removes item from inventory location | |
static proto native bool | LocationMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc) |
removes item from current inventory location and adds it to destination | |
static proto native bool | LocationSyncMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc) |
synchronously removes item from current inventory location and adds it to destination no anims involved | |
static proto native bool | LocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2) |
swaps two entities | |
static proto native bool | ServerLocationMoveEntity (notnull EntityAI item, ParamsWriteContext ctx) |
removes item from current inventory location and adds it to destination + sync via inventory command | |
static proto native bool | ServerLocationSyncMoveEntity (Man player, notnull EntityAI item, ParamsWriteContext ctx) |
synchronously removes item from current inventory location and adds it to destination + sync via inventory command no anims involved | |
static proto native bool | ServerLocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, ParamsWriteContext ctx) |
swaps two entities | |
static proto native bool | ServerHandEvent (notnull Man player, notnull EntityAI item, ParamsWriteContext ctx) |
hand event to clients | |
static proto native bool | PrepareDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1) |
Finds a transformation for the item to be dropped to If the initial transforation overlaps with another conflicting entity (i.e. car) then the transform will be snapped to the nearest outer edge. If no valid snapping transformation could be found, then the output from 'PlaceOnSurface' is used. | |
static proto native bool | TestDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1) |
static proto native bool | CanSwapEntities (notnull EntityAI item1, notnull EntityAI item2) |
test if ordinary swap can be performed. | |
static bool | CanSwapEntitiesEx (notnull EntityAI item1, notnull EntityAI item2) |
static proto native bool | CanForceSwapEntities (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst) |
test if forced swap can be performed. | |
static bool | CanForceSwapEntitiesEx (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst) |
static bool | MakeDstForSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2) |
helper function for swap | |
static bool | MakeSrcAndDstForSwap (notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2) |
helper function for swap | |
static bool | MakeSrcAndDstForForceSwap (notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, notnull InventoryLocation dst2) |
helper function for ForceSwap | |
static bool | SetGroundPosByOwner (EntityAI owner, notnull EntityAI item, out InventoryLocation ground) |
static bool | SetGroundPosByTransform (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector transform[4]) |
static void | SetGroundPosByOwnerBounds (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector halfExtents, float angle, float cosAngle, float sinAngle) |
Static Private Attributes | |
static protected int | m_inventory_check_context = InventoryCheckContext.DEFAULT |
const int | c_InventoryReservationTimeoutMS = 5000 |
reservations | |
const int | c_InventoryReservationTimeoutShortMS = 3000 |
bool | AddInventoryReservationEx (EntityAI item, InventoryLocation dst, int timeout_ms) |
bool | ExtendInventoryReservationEx (EntityAI item, InventoryLocation dst, int timeout_ms) |
bool | ClearInventoryReservationEx (EntityAI item, InventoryLocation dst) |
proto native int | GetAnyInventoryReservationCount () |
static proto native bool | AddInventoryReservation (EntityAI item, InventoryLocation dst, int timeout_ms) |
static proto native bool | ExtendInventoryReservation (EntityAI item, InventoryLocation dst, int timeout_ms) |
static proto native bool | ClearInventoryReservation (EntityAI item, InventoryLocation dst) |
static proto native bool | HasInventoryReservation (EntityAI item, InventoryLocation dst) |
Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY, FindInventoryReservationMode.LEGACY) | |
static proto native bool | HasInventoryReservationCanAdd (EntityAI item, InventoryLocation dst) |
Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM, FindInventoryReservationMode.DST) | |
static proto native bool | HasInventoryReservationEx (EntityAI item, InventoryLocation dst, FindInventoryReservationMode itemMode, FindInventoryReservationMode parentMode) |
itemMode will iterate over item reservations, parentMode will iterate over parent reservations | |
static proto native bool | GetInventoryReservationCount (EntityAI item, InventoryLocation dst) |
const float | c_MaxItemDistanceRadius = 2.5 |
anti-cheats | |
static proto native bool | CheckRequestSrc (notnull Man requestingPlayer, notnull InventoryLocation src, float radius) |
static proto native bool | CheckDropRequest (notnull Man requestingPlayer, notnull InventoryLocation src, float radius) |
static proto native bool | CheckTakeItemRequest (notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius) |
static proto native bool | CheckMoveToDstRequest (notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius) |
static proto native bool | CheckSwapItemsRequest (notnull Man requestingPlayer, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius) |
static proto native bool | CheckManipulatedObjectsDistances (notnull EntityAI e0, notnull EntityAI e1, float radius) |
script counterpart to engine's class Inventory
|
inlineprivate |
add entity somewhere in inventory
All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.
@NOTE: AddEntityToInventory does not perform the checks the CanAddEntityToInventory does (script conditions for example). if not sure, always call CanAddEntityToInventory before AddEntityToInventory.
[in] | item | item to be placed in inventory |
References FindFreeLocationFor(), and LocationAddEntity().
|
staticprivate |
Referenced by AddInventoryReservationEx().
|
inlineprivate |
|
inlineprivate |
Returns true if item is considered reachable within inventory.
References ErrorEx, and GetInventoryOwner().
|
private |
Returns count of attachments attached to this item.
Referenced by GetClosestCarWheel(), and ClosableContainer::RecomputeContainers().
|
private |
Check if attachment can be added to any slot.
Referenced by ActionAttachOnSelection::FindSlotIdToAttachOrCombine().
Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp.
|
private |
|
private |
|
inlineprivate |
Asks inventory if item could be placed in inventory, hands, etc.
Location is based on the flags parameter. This method is used in methods that are asking for if item can be placed in specific location, like CanAddEntityToInventory, CanAddEntityInHands, etc.
[in] | item | item to be placed in inventory |
[in] | flags | FindInventoryLocationType |
References FindFreeLocationFor().
Referenced by CanAddEntityIntoHands(), and CanAddEntityIntoInventory().
Test if entity can be put into hands.
References CanAddEntityInto().
Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment)
References CanAddEntityInto().
|
inlineprivate |
ask inventory if item could be placed somewhere in inventory
All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.
[in] | item | item to be placed in inventory |
References FindFreeLocationFor().
|
private |
|
staticprivate |
test if forced swap can be performed.
[in] | item1 | is the forced item (primary) |
[in] | item1_dst | optional destination for item1 (null if item1 goes to place of item2) |
[in] | item2 | second item that will be replaced by the item1. (secondary) |
[out] | item2_dst | second item's potential destination (if null, search for item_dst2 is ommited). if (NOT null AND IsValid()), then it is tried first, without search to inventory |
Referenced by CanForceSwapEntitiesEx().
|
inlinestaticprivate |
References CanForceSwapEntities(), and InventoryLocation::GetSlot().
Referenced by HandEventBase::CanPerformEvent(), HandEventSwap::CanPerformEvent(), WeaponManager::CanSwapMagazine(), LayoutHolder::CanSwapOrTakeToHandsEx(), Icon::DraggingOverSwap(), ItemManager::GetChosenCombinationFlag(), HandGuardBase::GuardCondition(), HandStartAction::OnEntry(), ManBase::OnQuickBarSingleUse(), WeaponManager::PrepareInventoryLocationForMagazineSwap(), Icon::Swap(), and ValidateSwap().
|
inlineprivate |
Returns if entity can be removed from its current location.
References GetCurrentInventoryLocation(), and LocationCanRemoveEntity().
|
private |
test if ordinary swap can be performed.
Ordinary in the sense that the two items has equal sizes and can be swapped without additional space.
[in] | item1 | first item |
[in] | item2 | second item |
Referenced by CanSwapEntitiesEx().
|
inlinestaticprivate |
References CanSwapEntities(), and InventoryLocation::GetSlot().
Referenced by WeaponManager::CanSwapMagazine(), LayoutHolder::CanSwapOrTakeToHandsEx(), AttachmentCategoriesRow::Combine(), PlayerContainer::DraggingOver(), HandsContainer::DraggingOverHeader(), AttachmentCategoriesRow::DraggingOverHeader(), ClosableContainer::DraggingOverHeader(), VicinityContainer::DraggingOverIcon(), ItemManager::GetChosenCombinationFlag(), HandsContainer::GetCombinationFlags(), InventoryGridController::GetQuickbarItemColor(), HandGuardBase::GuardCondition(), PlayerContainer::OnDropReceivedFromGhostArea(), AttachmentCategoriesRow::OnDropReceivedFromHeader(), VicinityContainer::OnDropReceivedFromIcon(), ManBase::OnQuickBarSingleUse(), WeaponManager::PrepareInventoryLocationForMagazineSwap(), Attachments::Select(), Container::Select(), HandsPreview::Select(), AttachmentCategoriesRow::Select(), PlayerContainer::Select(), VicinitySlotsContainer::Select(), ZombieContainer::Select(), EntityAI::SwapEntitiesImpl(), HumanInventory::SwappingToPreviousLocation(), HandsContainer::TakeAsAttachment(), and ClosableContainer::TakeAsAttachment().
|
staticprivate |
|
staticprivate |
Referenced by VicinityItemManager::AddVicinityItems().
|
staticprivate |
Referenced by HandEventBase::CheckRequest().
|
staticprivate |
Referenced by HandEventBase::CheckRequestSrc().
|
staticprivate |
Referenced by HandEventBase::CheckRequest(), and HandEventSwap::CheckRequest().
|
staticprivate |
|
staticprivate |
Referenced by HandStateEquipped::OnEntry().
|
inlineprivate |
References ClearInventoryReservation(), InventoryLocation::DumpToStringNullSafe(), GetGame(), CGame::GetPlayer(), Debug::InventoryMoveLog(), and LogManager::IsInventoryReservationLogEnable().
Referenced by ClearInventoryReservation(), DeferredSwapEntities::ClearInventoryReservation(), and DeferredSwapEntities::ReserveInventory().
|
private |
almost identical to EnumerateInventory except it does not return items
|
private |
Create Entity of specified type as attachment of entity.
Create Entity of specified type as attachment of entity.
typeName | type to create |
slotId | the slot to be created in |
Create Entity of specified type in cargo of entity.
|
private |
Create Entity of specified type in cargo of entity at coordinates (row, col)
typeName | type to create |
row | the row of cargo to be created at |
col | the column of cargo to be created at |
|
inlineprivate |
creates entity somewhere in inventory
[in] | type | item type to be placed in inventory |
References Error(), FindFirstFreeLocationForNewEntity(), InventoryLocation::GetCol(), InventoryLocation::GetFlip(), InventoryLocation::GetIdx(), InventoryLocation::GetParent(), InventoryLocation::GetRow(), InventoryLocation::GetSlot(), and InventoryLocation::GetType().
Referenced by AK101_Base::OnDebugSpawn(), AK74_Base::OnDebugSpawn(), AKM_Base::OnDebugSpawn(), Aug_Base::OnDebugSpawn(), FAL_Base::OnDebugSpawn(), M14_Base::OnDebugSpawn(), M4A1_Base::OnDebugSpawn(), Rifle_Base::OnDebugSpawn(), Colt1911_Base::OnDebugSpawn(), CZ75_Base::OnDebugSpawn(), Deagle_Base::OnDebugSpawn(), FNX45_Base::OnDebugSpawn(), Glock19_Base::OnDebugSpawn(), MakarovIJ70_Base::OnDebugSpawn(), B95_base::OnDebugSpawn(), Mosin9130_Base::OnDebugSpawn(), Ruger1022_Base::OnDebugSpawn(), SVD_Base::OnDebugSpawn(), Mp133Shotgun_Base::OnDebugSpawn(), Saiga_Base::OnDebugSpawn(), CZ61_Base::OnDebugSpawn(), MP5K_Base::OnDebugSpawn(), PP19_Base::OnDebugSpawn(), UMP45_Base::OnDebugSpawn(), PluginBase::SpawnEntityAsAttachment(), and Entity::SpawnInInventoryOrGroundPos().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
References GetInventoryOwner().
|
inlineprivate |
|
private |
enumerate inventory using traversal type and filling items array
[in] | tt | used traversal type |
[out] | items | items in inventory (in order determined by traversal) |
Referenced by AddDamageToItemByFireEx(), InventoryItem::ClearInventory(), ManBase::ClearInventory(), and PrintAll().
|
staticprivate |
Referenced by ExtendInventoryReservationEx().
|
inlineprivate |
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
Referenced by ActionAttachOnSelection::FindSlotIdToAttachOrCombine(), and AnalyticsManagerClient::OnItemAttachedAtPlayer().
Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id)
|
private |
FindFirstFreeLocationForNewEntity.
[in] | item_type | item type that would be placed in inventory |
[out] | loc | the InventoryLocation the item can be placed to |
Referenced by CreateInInventory().
|
private |
FindFreeLocationFor.
[in] | item | item that would be placed in inventory |
[out] | loc | the InventoryLocation the item can be placed to |
Referenced by AddEntityToInventory(), CanAddEntityInto(), CanAddEntityToInventory(), HumanInventory::TakeEntityToInventory(), and TakeEntityToInventory().
|
private |
FindFreeLocationForEx.
[in] | item | item that would be placed in inventory |
[out] | loc | the InventoryLocation the item can be placed to |
|
private |
searches inventory for suitable location for @item
[in] | item | item that would be placed in inventory |
[in] | flags | flags affecting selection ( |
[out] | locs | array of InventoryLocations the item can be placed to |
Example:
Returns placeholder entity for slot (naked arms, legs etc)
|
private |
|
inlineprivate |
|
private |
|
private |
Referenced by GetClosestCarWheel(), and ClosableContainer::RecomputeContainers().
|
private |
index | index of the slot for attachment ( |
Referenced by HasAttachmentSlot().
|
private |
Referenced by HasAttachmentSlot().
|
private |
cargo
Referenced by InventoryItem::CanReceiveAttachment(), and StopCooling().
Returns true if the item is currently attached and outputs attachment slot id and name.
References GetCurrentInventoryLocation(), InventoryLocation::GetSlot(), InventorySlots::GetSlotName(), InventoryLocation::GetType(), and InventorySlots::INVALID.
|
private |
returns information about current item location
[out] | loc | current InventoryLocation |
Referenced by CanRemoveEntity(), EEInit(), GetCurrentAttachmentSlotInfo(), IsAttachment(), and IsInCargo().
|
private |
|
inlinestaticprivate |
References m_inventory_check_context.
Referenced by Container_Base::CanReceiveItemIntoCargo().
|
private |
Engine native functions.
Referenced by AreChildrenAccessible(), EEDelete(), HumanInventory::GetManOwner(), Init(), IsCargoInHiearchy(), HumanInventory::LocalDestroyEntity(), HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl(), HumanInventory::ReplaceItemInHandsWithNewImpl(), HumanInventory::TakeEntityAsAttachmentEx(), TakeEntityAsAttachmentEx(), HumanInventory::TakeEntityToCargoEx(), and TakeEntityToCargoEx().
|
staticprivate |
|
private |
|
private |
attachments
index | index into array of configured slots ( |
|
private |
|
private |
brief Returns True if entity is attached to this
brief Returns True if entity is attached to this in slot
|
inlineprivate |
References GetAttachmentSlotId(), and GetAttachmentSlotsCount().
|
private |
query inventory if item is somewhere
All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.
[in] | item | item to be found in inventory |
|
staticprivate |
Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY, FindInventoryReservationMode.LEGACY)
Referenced by HandStateEquipped::OnEntry(), ReserveInventory(), and DeferredSwapEntities::ReserveInventory().
|
staticprivate |
Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM, FindInventoryReservationMode.DST)
|
staticprivate |
itemMode will iterate over item reservations, parentMode will iterate over parent reservations
|
private |
|
private |
|
inlineprivate |
|
inlineprivate |
Returns true if this Inventory owner is an attachment of something.
References GetCurrentInventoryLocation(), and InventoryLocation::GetType().
|
inlineprivate |
Returns true if inventory owner or his hiearchy parents are in cargo.
References GetInventoryOwner(), InventoryLocation::GetType(), and InventoryLocation::IsValid().
|
inlineprivate |
Returns true if this Inventory owner is in cargo of something.
References GetCurrentInventoryLocation(), and InventoryLocation::GetType().
Referenced by EntityLightSource::CheckIfParentIsInCargo().
|
private |
|
private |
Referenced by VicinityContainer::UpdateInterval().
|
staticprivate |
adds item to inventory location
Referenced by AddEntityToInventory(), and ReplaceItemWithNewLambdaBase::UndoRemoveOldItemFromLocation().
|
staticprivate |
queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...
query the entity at the specific inventory location
Referenced by LocationCanAddEntityEx(), and TransferInventory().
|
inlinestaticprivate |
References LocationCanAddEntity().
|
staticprivate |
queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthand for CanRemove + CanAdd query
Referenced by HandEventBase::CanPerformEvent(), HandEventBase::CanPerformEventEx(), HandGuardBase::GuardCondition(), LocationCanMoveEntitySyncCheck(), WeaponStateBase::OnAbort(), OnAbort(), WeaponStateBase::OnExit(), and ValidateSyncMove().
|
inlinestaticprivate |
References LocationCanMoveEntity(), and m_inventory_check_context.
Referenced by ValidateSyncMove().
|
staticprivate |
queries if the entity contained in inv_loc.m_item can be removed from ground/attachment/cargo/hands/...
Referenced by ReplaceItemWithNewLambdaBase::CanExecuteLambda(), CanRemoveEntity(), and ActionDigInStash::OnFinishProgressServer().
|
staticprivate |
creates new item directly at location
[in] | type | item type to be placed in inventory |
Referenced by ReplaceItemWithNewLambdaBase::CreateNewEntity(), SpawnEntity(), InventoryItem::SplitIntoStackMaxToInventoryLocationEx(), InventoryItem::SplitItemToInventoryLocation(), ThrowEntityFromInventory(), and ActionUncoverHeadBase::UncoverHead().
|
staticprivate |
creates new local item directly at location @NOTE: the item is created localy, i.e. it's not registered to network
[in] | type | item type to be placed in inventory |
Referenced by ReplaceItemWithNewLambdaBase::CreateNewEntity().
|
staticprivate |
|
staticprivate |
removes item from current inventory location and adds it to destination
|
staticprivate |
removes item from inventory location
Referenced by ReplaceItemWithNewLambdaBase::RemoveOldItemFromLocation().
|
staticprivate |
swaps two entities
Referenced by HandActionBase::Action(), HandStartAction::OnEntry(), and OnServerInventoryCommandStatic().
|
staticprivate |
synchronously removes item from current inventory location and adds it to destination no anims involved
Referenced by HandActionBase::Action(), HandleDropMagazine(), WeaponStateBase::OnAbort(), OnAbort(), HandStateBase::OnEntry(), HandStartAction::OnEntry(), WeaponStateBase::OnEntry(), WeaponStateBase::OnExit(), OnServerInventoryCommandStatic(), and TakeToDst().
|
staticprivate |
test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...
Referenced by HandGuardBase::GuardCondition().
|
private |
|
private |
|
inlinestaticprivate |
helper function for swap
Referenced by MakeSrcAndDstForSwap().
|
inlinestaticprivate |
helper function for ForceSwap
Referenced by HumanInventory::ForceSwapEntities(), and ForceSwapEntities().
|
inlinestaticprivate |
helper function for swap
References MakeDstForSwap().
Referenced by HandleSwapEntities(), HumanInventory::SwapEntities(), and SwapEntities().
|
private |
|
private |
synchronization
|
private |
Referenced by DropEntity().
|
private |
|
private |
|
private |
|
private |
|
inlinestaticprivate |
References HandEventBase::DumpToString(), InventoryLocation::DumpToStringNullSafe(), Error(), GetGame(), InventoryLocation::GetItem(), GetTime(), LogManager::IsSyncLogEnable(), InventoryLocation::IsValid(), LocationSwap(), LocationSyncMoveEntity(), Serializer::Read(), InventoryLocation::ReadFromContext(), and syncDebugPrint().
|
inlineprivate |
db load hooks
|
private |
db store hook
|
staticprivate |
Finds a transformation for the item to be dropped to If the initial transforation overlaps with another conflicting entity (i.e. car) then the transform will be snapped to the nearest outer edge. If no valid snapping transformation could be found, then the output from 'PlaceOnSurface' is used.
useValuesInMatrix | Is ignored if transformation overlaps with possible conflicting entity. If no valid transform is found and this is false then the transform at the owner is used for 'PlaceOnSurface' |
conflictCheckDepth | If -1 then no conflict depth check is performed, if 0 then it only checks to see if it conflicts but doesn't perform snapping |
Referenced by DropEquipAndDestroyRootLambda::CopyOldPropertiesToNew(), HandleDropMagazine(), ManBase::PredictiveDropEntity(), SetGroundPosByOwner(), and SetGroundPosByTransform().
|
inlineprivate |
|
private |
|
staticprivate |
hand event to clients
Referenced by InventoryInputUserData::SendServerHandEventViaInventoryCommand().
|
staticprivate |
removes item from current inventory location and adds it to destination + sync via inventory command
|
staticprivate |
swaps two entities
Referenced by InventoryInputUserData::SendServerSwap().
|
staticprivate |
synchronously removes item from current inventory location and adds it to destination + sync via inventory command no anims involved
Referenced by InventoryInputUserData::SendServerMove().
|
private |
|
inlinestaticprivate |
References GameConstants::INVENTORY_ENTITY_DROP_OVERLAP_DEPTH, Math3D::MatrixIdentity4(), and PrepareDropEntityPos().
Referenced by HandEventRemove::CanPerformEventEx(), HandEventRemove::CheckRequestEx(), DropEntity(), OnEntry(), ActionUnpackGift::OnFinishProgressServer(), and StaticConstructionMethods::SpawnConstructionMaterialPiles().
|
inlinestaticprivate |
References Math::RandomFloat(), vector::RotateAroundZero(), vector::Up, and Vector().
Referenced by DropEntityInBounds().
|
inlinestaticprivate |
References GameConstants::INVENTORY_ENTITY_DROP_OVERLAP_DEPTH, and PrepareDropEntityPos().
Referenced by DropEntityWithTransform().
|
inlineprivate |
|
inlineprivate |
References inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeEntityToInventory().
Referenced by EntityAI::TakeEntityAsAttachmentImpl().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
put item as attachment of target
References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetAttachment(), and TakeToDst().
Referenced by TakeEntityAsAttachmentEx().
|
inlineprivate |
moves item to cargo of this intentory
[in] | mode | inventory mode |
[in] | item | item to be put in this inventory as cargo |
References inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeEntityToInventory().
Referenced by EntityAI::TakeEntityToCargoImpl().
|
inlineprivate |
moves item on specific cargo location
[in] | mode | inventory mode |
[in] | item | item to be put in this inventory as cargo |
References Error(), GetInventoryOwner(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetCargo(), and TakeToDst().
|
inlineprivate |
Put item anywhere into this entity (as attachment or into cargo, recursively)
[in] | mode | inventory mode |
[in] | flags | preferred location, |
[in] | item | item to be taken in inventory |
@NOTE: Predictive.* / Local.* functions: a) 'Predictive' means that the operation uses Client-Side Prediction, i.e. the action runs the same code on both, client AND server.
b) 'Local' operation executes from where it is run, i.e. the operation from client is NOT sent to server, and only client performs the inventory operation (TakeEntityTo.*) this behaviour is necessary when inventory operations are ALREADY synchronized by another means, like Actions. For example
References Error(), FindFreeLocationFor(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeToDst().
Referenced by TakeEntityAsAttachment(), and TakeEntityToCargo().
|
inlineprivate |
Put item into into cargo of another entity.
References inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeEntityToTargetInventory().
|
inlineprivate |
Put item into into cargo on specific cargo location of another entity.
References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetCargoAuto(), and TakeToDst().
|
inlineprivate |
helper that finds location first, then moves the entity into it
References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeToDst().
Referenced by TakeEntityAsTargetAttachment(), and TakeEntityToTargetCargo().
|
inlineprivate |
move src to dst
[in] | mode | inventory mode |
[in] | src | source location of the item |
[in] | dst | destination location of the item |
References LocationSyncMoveEntity(), and InventoryInputUserData::SendServerMove().
Referenced by DropEntity(), DropEntityInBounds(), DropEntityWithTransform(), TakeEntityAsTargetAttachmentEx(), TakeEntityToCargoEx(), TakeEntityToInventory(), TakeEntityToTargetCargoEx(), and TakeEntityToTargetInventory().
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
reservations
Referenced by ActionBase::InventoryReservation(), ActionRemoveSeed::InventoryReservation(), ActionTakeArrow::InventoryReservation(), ActionTakeArrowToHands::InventoryReservation(), ActionTakeHybridAttachment::InventoryReservation(), ActionTakeItem::InventoryReservation(), FirearmActionAttachMagazine::InventoryReservation(), FirearmActionAttachMagazineQuick::InventoryReservation(), WeaponManager::InventoryReservation(), SendServerHandEventViaJuncture(), SetEmoteLockState(), TakeToDst(), TryAcquireInventoryJunctureFromServer(), and TryAcquireTwoInventoryJuncturesFromServer().
|
private |
Referenced by InventoryItem::CombineItemsClient(), HandGuardBase::GuardCondition(), HandleForceSwapEntities(), HandleSwapEntities(), HandleTakeToDst(), HandStateBase::OnEntry(), InventoryItem::OnRightClick(), ReserveInventory(), HandEventBase::ReserveInventory(), ReserveInventory(), DeferredSwapEntities::ReserveInventory(), and ValidateSwap().
|
private |
anti-cheats
Referenced by HandEventBase::CheckRequest(), HandEventSwap::CheckRequest(), HandEventBase::CheckRequestSrc(), PlayerCheckSwapItemsRequest(), ValidateDestroy(), ValidateSwap(), and ValidateSyncMove().
|
staticprivate |
Referenced by GetInventoryCheckContext(), and LocationCanMoveEntitySyncCheck().