This commit is contained in:
the me 2022-08-15 18:01:09 -07:00
parent 0ead044da1
commit 51cc3f3ca6
20 changed files with 278 additions and 33 deletions

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "data",
"path": "folders/Scripts/util/data.yy",
},
"resourceVersion": "1.0",
"name": "array_contains",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
function array_contains_within(array, val) {
var i, j;
for (i=0; i<array_length(array); i++) {
if typeof(array[i]) == "struct" {
var dudes = variable_struct_get_names(array[i]);
for (j=0; j<array_length(dudes); j++) {
if array[i][$dudes[j]] == val return true;
}
}
}
return false;
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "data",
"path": "folders/Scripts/util/data.yy",
},
"resourceVersion": "1.0",
"name": "array_contains_within",
"tags": [],
"resourceType": "GMScript",
}