I’m trying to set up a function that can work for multiple different sets of arrays and variables that are uniformly named but only the first word is changed in each. Is there a way to make this more efficiently where somehow I could do something like
set {BlockType}PropsHealth = for (Manipulator : {BlockType}PropManipulators) do {BlockType}Health
This is the current code:
PopulateBlocks(BlockType : string) : void =
if (BlockType = "Coal"):
set CoalPropsHealth = for (Manipulator : CoalPropManipulators) do CoalHealth
else if (BlockType = "Stone"):
set StonePropsHealth = for (Manipulator : StonePropManipulators) do StoneHealth