You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementation:
for i in range elements in array 1 iterate for j in range elements in array 2, if element i of array 1 == element j of array 2 return true, if iterations end and it didn't return true, return false
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, one can make a function to do that that would take 6 lines of GDScript code (func, 2 for loops, if, 2 returns)
Is there a reason why this should be core and not an add-on in the asset library?
Array is core
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
Various
Describe the problem or limitation you are having in your project
There are multiple instances where knowing if 2 arrays have any shared data would could be useful
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Adding a Shared() method to Arrays would allow for very simple, single line checks if there is any identical data between 2 arrays.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Array1=[0,1,2]
Array2=[0,4,5,6,7]
Array1.Shared(Array2) -> returns true
Array1=[0,1,2]
Array2=[3,4]
Array1.Shared(Array2) -> returns false
Implementation:
for i in range elements in array 1 iterate for j in range elements in array 2, if element i of array 1 == element j of array 2 return true, if iterations end and it didn't return true, return false
If this enhancement will not be used often, can it be worked around with a few lines of script?
Yes, one can make a function to do that that would take 6 lines of GDScript code (func, 2 for loops, if, 2 returns)
Is there a reason why this should be core and not an add-on in the asset library?
Array is core
The text was updated successfully, but these errors were encountered: