MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetArraySlot

Function GetArraySlot

TombEngine/Game/pickup/pickuputil.h:14–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12// Given an array and an Object ID, iterate through the array until we find
13// an ID that matches the ID we've passed in.
14template <typename T, size_t N> int GetArraySlot(std::array<T, N> const& arr, GAME_OBJECT_ID objectID)
15{
16 for (int i = 0; i < arr.size(); ++i)
17 {
18 if (objectID == arr[i].ObjectID)
19 return i;
20 }
21
22 return NO_VALUE;
23}

Callers 9

TryModifyWeaponFunction · 0.85
HasWeaponFunction · 0.85
InitializeConsumablesFunction · 0.85
TryModifyingConsumableFunction · 0.85
GetConsumableCountFunction · 0.85
TryModifyingAmmoFunction · 0.85
GetAmmoCountFunction · 0.85
GetDefaultAmmoCountFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected