using System;
using System.Collections;
namespace Unity.VisualScripting
{
///
/// Inserts an item in a list at a specified index.
///
[UnitCategory("Collections/Lists")]
[UnitSurtitle("List")]
[UnitShortTitle("Insert Item")]
[UnitOrder(3)]
[TypeIcon(typeof(AddListItem))]
public sealed class InsertListItem : Unit
{
///
/// The entry point for the node.
///
[DoNotSerialize]
[PortLabelHidden]
public ControlInput enter { get; private set; }
///
/// The list.
///
[DoNotSerialize]
[PortLabel("List")]
[PortLabelHidden]
public ValueInput listInput { get; private set; }
///
/// The list with the added element.
/// Note that the input list is modified directly and then returned,
/// except if it is an array, in which case a new array with
/// the added element is returned instead.
///
[DoNotSerialize]
[PortLabel("List")]
[PortLabelHidden]
public ValueOutput listOutput { get; private set; }
///
/// The zero-based index at which to insert the item.
///
[DoNotSerialize]
public ValueInput index { get; private set; }
///
/// The item to insert.
///
[DoNotSerialize]
public ValueInput item { get; private set; }
///
/// The action to execute once the item has been inserted.
///
[DoNotSerialize]
[PortLabelHidden]
public ControlOutput exit { get; private set; }
protected override void Definition()
{
enter = ControlInput(nameof(enter), Insert);
listInput = ValueInput(nameof(listInput));
item = ValueInput