Skip to content

collection_commands

shalliwell edited this page May 25, 2020 · 1 revision

Collection commands

Add

Add an item to a collection

Defined in Fungus.CollectionCommandAdd

Property Type Description
Only If Unique Fungus.BooleanData Only add if the item does not already exist in the collection

Add All

Add all items in given rhs collection to target collection

Defined in Fungus.CollectionCommandAddAll

Property Type Description
Only If Unique Fungus.BooleanData Only add if the item does not already exist in the collection

Clear

Clears a target collection

Defined in Fungus.CollectionCommandClear

Contains

Does the collection contain the given variable

Defined in Fungus.CollectionCommandContains

Contains All Of

Does target collection, contain all rhs collection items

Defined in Fungus.CollectionCommandContainsAll

Property Type Description
In Same Order Fungus.BooleanData Do they have to be in the same order?

Contains Any Of

Does target collection, contain any of the items in the rhs collection items

Defined in Fungus.CollectionCommandContainsAny

Copy

Clears target and then adds all of rhs to target.

Defined in Fungus.CollectionCommandCopy

Count

Number of items in the collection

Defined in Fungus.CollectionCommandCount

Element

Get or Set, an element in a collection

Defined in Fungus.CollectionCommandElement

Exclusive

Remove all items from collection that are also in RHS and add all the items in RHS that are not already in target. Similar to a xor

Defined in Fungus.CollectionCommandExclusive

Find

Find an item in a collection

Defined in Fungus.CollectionCommandFind

Property Type Description
Last Instead Of First Fungus.BooleanData If true, will find the last occurance rather than first occurance.

For Each

Loop over each element in the given collection, similar to a foreach but internally uses indicies

Defined in Fungus.ForEach

Property Type Description
Cur Index Fungus.IntegerData Optional

IndexOf

Find an item in a collection

Defined in Fungus.CollectionCommandFind

Property Type Description
Last Instead Of First Fungus.BooleanData If true, will find the last occurance rather than first occurance.

Insert

Add at a specific location in the collection

Defined in Fungus.CollectionCommandInsert

Intersection

Remove all items from collection that aren't also in RHS, similar to an overlap.

Defined in Fungus.CollectionCommandIntersection

Length

Number of items in the collection

Defined in Fungus.CollectionCommandCount

Occurrences

How many occurrences of a given variable exist in a target collection

Defined in Fungus.CollectionCommandOccurrences

RandomBag

Use the collection as a source of random items and turn it into a random bag. Drawing the next random item until out of items and then reshuffling them.

Defined in Fungus.CollectionRandomBag

Property Type Description
Duplicates To Put In Bag Fungus.IntegerData Will add this many copies to the bag. If you want 5 of everything, you want 4 copies.

RandomItem

Use the collection as a source of random selection. Picking a random item each run.

Defined in Fungus.CollectionRandom

Remove

Remove an item to a collection

Defined in Fungus.CollectionCommandRemove

Property Type Description
All Occurances Fungus.BooleanData Should it remove ALL occurances of variable

Remove All Of

Remove all items in given rhs collection to target collection

Defined in Fungus.CollectionCommandRemoveAllOf

Remove At

Remove item at given index

Defined in Fungus.CollectionCommandRemoveAt

Reserve

Reserve space for given number of items in the collection

Defined in Fungus.CollectionCommandReserve

Resize

Resize will grow the collection to be the given size, will not remove items to shrink

Defined in Fungus.CollectionCommandResize

Reverse

Reverse the current order of a target collection

Defined in Fungus.CollectionCommandReverse

Shuffle

Randomly reorders all elements of a target collection

Defined in Fungus.CollectionCommandShuffle

Sort

Sort a target collection

Defined in Fungus.CollectionCommandSort

Unique

Removes all duplicates.

Defined in Fungus.CollectionCommandUnique Auto-Generated by Fungus.ExportReferenceDocs

Clone this wiki locally