Skip to content
mystborn edited this page Jun 22, 2018 · 1 revision

ds_list

A ds_list is a simple list object.

Fields

count

Description: Gets the number of elements in the list.

Returns: number

Constructor

new()

Description: Initializes an empty list.

Returns: ds_list

Scripts

add(..values)

Argument Expected Type Description
..values objects Any number of values to add to the list.

Description: Adds the values to the end of the list.

Returns: null

clear()

Description: Removes all values from the list.

Returns: null

copy()

Description: Creates a shallow copy of the list.

Returns: ds_list

get(index)

Argument Expected Type Description
index number The index of the value to get.

Description: Gets the value at the specified index in the list.

Returns: object

insert(index, value)

Argument Expected Type Description
index number The index to insert the value.
value object The value to insert.

Description: Inserts a value into the list at the specified index.

Returns: null

index_of(value)

Argument Expected Type Description
value object The value to search for.

Description: Finds the index of the first occurrence of the value in the list. Returns -1 if the value isn't found.

Returns: number

remove(index)

Argument Expected Type Description
index number The index of the item to remove.

Description: Removes the value at the specified index within the list.

Returns: null

set(index, value)

Argument Expected Type Description
index number The index of the item to set.
value object The value to set the index.

Description: Sets the value at the specified index within the list. If index is greater than the size of the list, null elements will be added until the index can be set.

Returns: null

Clone this wiki locally