List T API
name | type | parameters | description |
---|---|---|---|
List New | action | list name <string>, values type <preset - List Values Type> | Initializes new list of given type. List name is unique per type. Creating 2 lists of int with name 'something' will not work, but 2 lists of int and string with same name will work |
List Set <T> | action | list name <string>, index <integer>, value <T> | Sets value at given index in given list |
List Get <T> | function <T> | list name <string>, index <integer> | Gets value at given index in given list |
List Add <T> | action | list name <string>, value <T> | Adds new value to the list. This also resize the list |
List IndexOf <T> | function <integer> | list name <string>, value <T> | Returns first found index with given value. Returns -1 if value is not in the list |
For Each Value in List <T> | action | Type name <T>, list name <string> | GUI Only. Preform for each loop thru given list |
List Values Count | function <integer> | list name <string>, values type <preset - List Values Type> | Returns count of items in given list |
List Remove At | action | list name <string>, value type <preset - List Values Type>, index <integer> | Removes value at given index from given list and shrinks the list by 1 |
List Clear | action | list name <string>, values type <preset - List Values Type> | Clears all list data including list itself |
List Exist | function <boolean> | list name <string>, values type <preset - List Values Type> | Checks if given list exist |
Note: Not all functions have safety checks but those usually won't cause issues if used wrong way.
Note 2:Any other functions really would be wrappers around those functions. IndexOf<T> already is. I simply don't want to spam GUI because there needs to be 1 function per type.
For example to remove specific value from list you would do RemoveAt(IndexOf(value)). Only missing function is InsertAt but you probably wouldn't use it anyway.
To preform basic 'for' with 'i' index you would use 'for each integer i from 0 to (List values count-1)
Comments