Skip to content

Conversation

@Alienmario
Copy link
Contributor

@Alienmario Alienmario commented Nov 3, 2024

Adds new optional parameters to ArrayList find natives.

  • FindString: start index, reverse search, case sensitivity
  • FindValue: start index, reverse search
int found = 0; index = -1;
while ((index = list.FindString("str-val", TestStruct::strval, index)) != -1)
{
	found++;
}

The intention is to cover most general use cases of easily and efficiently iterating over ArrayLists (including enum struct ArrayLists).
The convention for the start index parameter matches that of FindEntityByClassname - startEnt. Its default of -1 allows starting from either side of the array, without manually passing the first index.
Test is included in PR, tested on linux, passed.

I am still learning, so excuse any newbie mistakes. I'm open to suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant