Categories > Data structure > rex_ginstgroup

Introduction

Stores instances reference by their UID in a group, each group is

Links


Categories > Data structure > rex_ginstgroupIntroductionLinksDependenceUsageManage groupAdd instance(s)Copy groupRemove instance(s)Clean or destroy groupInstance is in groupAmount of instancesDump instancesSOLPass SOL into functionSet operationsList/array operationsPushPopListRetrieveGet UID by indexGet index of UIDPrivate groupSave&Load

Dependence

None

Usage

Sample capx

Manage group

Add instance(s)

Add instance(s) into a group

Copy group

Action:Copy, copies content of a group to another one.

Remove instance(s)

Remove instance(s) from a group

Remove and destroy instances of a group

Clean or destroy group

Clean or destroy a group

Instance is in group

Condition:UID in group, returns true if an UID is in group.

Amount of instances

Expression:InstCnt( group ) , returns count of instances in group.

Dump instances

Dump instances of a group by Expression:GroupToString( group ) , which returns a JSON string of UID list.


SOL

Pick instances of a group

It is similar with Object condition: Pick by unique ID.

Pass SOL into function

Sample capx


Set operations

Merge two groups by one of these operations.


List/array operations

Instances in an order list.

Push

Pop

List

Action:Sort by function+Condition:On sortingPick instances:Expression:CmpUIDA,Expression:CmpUIDB-Action:Set comparing result

Retrieve

Retrieve instances

  1. Pick instances of group into SOL by Condition:Pick instances
  2. Retrieve instances in order by System condition:For each
+Condition:Pick instances+System condition:For eachSub event

Retrieve UID

  1. Condition:For each UID

    • Expression:Item, UID
    • Expression:Index
+Condition:For each UIDSub event----Expression:Item,Expression:Index
Get UID by index
Get index of UID

Private group

Expression: PrivateGroup( UID, group ) returns a special group name formatted by

 
xxxxxxxxxx
"@" + uid + "$" + group

, to bind a group with an instance. This group will be removed automatically when related instance had been destroyed.

For example, group @10$aa,@10$bb will be destroyed automatically when instances which uid=10 had been destroyed.


Save&Load

This plugin supports official save/load system, i.e. it could be saved&loaded automatically.

Or save/load manually,