Modded Element Sets
A feature that lazy-inits and caches various arrays and sets that include both vanilla and modded elements. This is useful for performance purposes (so that we do not have to reconstruct the arrays/sets multiple times).
The modded arrays/sets are created using the functions from
ISCFeature.MODDED_ELEMENT_DETECTION
.
Hierarchy
-
Feature
↳
ModdedElementSets
Methods
getCollectibleTypes
▸ getCollectibleTypes(): readonly CollectibleType
[]
Returns an array containing every valid collectible type in the game, including modded collectibles.
Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
then use the getCollectibleTypesSet
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
readonly CollectibleType
[]
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:494
getCollectibleTypeSet
▸ getCollectibleTypeSet(): ReadonlySet
<CollectibleType
>
Returns a set containing every valid collectible type in the game, including modded collectibles.
Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
then use the getCollectibleTypes
helper function instead.
This function can only be called if at least one callback has been executed. This is because not all collectible types will necessarily be present when a mod first loads (due to mod load order).
In order to use this function, you must upgrade your mod with ISCFeature.MODDED_ELEMENT_SETS
.
Returns
ReadonlySet
<CollectibleType
>
Defined in
packages/isaacscript-common/src/classes/features/other/ModdedElementSets.ts:515