Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

ProtoFlux:AddKey

From Resonite Wiki
AddKey
*
OnAdded
Dictionary
OnAlreadyExists
Key
OnFail
Value
Collections

The AddKey node takes in one of SyncRefDictionary, SyncFieldDictionary, or SyncTypeDictionary, then a key and a value, then attempts to add the KeyValuePair into the dictionary.

Known compatible types: SyncRefDictionary, SyncFieldDictionary, and SyncTypeDictionary.

Known incompatible types: IList and its subtypes (see Add (Collections) instead).

Acquiring This Node

A protoflux browser set to add value with object key with example valid inputs for the add value with object key node, dictionary field is filled in with sync field dictionary with types string and int, key field is filled in with string, and value field is filled in with int
Example valid inputs for the AddValueWithObjectKey node

When browsing to the AddKey node in the ProtoFlux Browser, there are 4 options. Which you choose is up to the dictionaries key and value types. Regardless of which you choose, there are 3 fields: TDictionary, TKey, and TValue. TDictionary takes the full type of the dictionary (e.g. SyncFieldDictionary<string,int>). TKey takes the type for the key (e.g. string). TValue takes the type for the value (e.g. int).

This node can safely be type converted when connecting an input while none of the Dictionary, Key, or Value inputs are connected.

Inputs

* (Call)

Calls an impulse to add a KeyValuePair into the Dictionary.

Dictionary (SyncRefDictionary)

The Dictionary to add the KeyValuePair to.

Key (Generic)

The unique key the value can be accessed with.

Value (Generic)

The value that will be paired with the key.

Outputs

OnAdded (Continuation)

Fires if the key provided was not present in the dictionary and the key value pair has successfully been added to the dictionary.

OnAlreadyExists (Continuation)

Fires if the key provided is already present in the dictionary.

To guarantee that a key exists and is set to a particular value, chain this continuation into a SetKey node.

OnFail (Continuation)

Fires if unable to add the KeyValuePair to the Dictionary.