Identity and input copying
Craftly distinguishes a binding (a Variable/field) from the object or collection it references. This matters whenever two inputs reach the same mutable data.
Reference: the default
Section titled “Reference: the default”Reference shares the object/List/Dictionary. If a and b reference the same list, appending through b changes what a sees. Reassigning b to a new list does not reassign a.
Primitive Number, String, Boolean, and Color values copy their value. Entity Targets retain UUID identity and are never cloned by input copying.
Shallow Copy
Section titled “Shallow Copy”Creates a new outer object or collection while retaining nested object references. If a copied List contains a mutable PlayerStats object, changing the outer List does not change the original List, but mutating that shared PlayerStats still affects both views.
Deep Copy
Section titled “Deep Copy”Creates a separate reachable object graph. Aliases and cycles inside the copied graph are preserved: two copied fields that originally pointed to the same object still point to the same copied object. Dictionary identity keys participate in the copy.
Copies preserve unassigned fields and Final field assignment state. They do not call constructors. Copying large graphs consumes heap and execution budgets; it is not an unlimited duplication operation.
Set the mode
Section titled “Set the mode”Shift-right-click a configured object, List, or Dictionary input to cycle Reference → Shallow Copy → Deep Copy. The choice belongs to that argument/assignment slot. Variable items do not carry a passing toggle. Replacing the input preserves the slot’s choice; ordinary right-click clears the input.
Comparison example
Section titled “Comparison example”| Action | Reference | Shallow Copy | Deep Copy |
|---|---|---|---|
| Mutate outer List | Shared | Separate | Separate |
| Mutate nested custom object | Shared | Shared | Separate |
| Rebind destination Variable | Separate binding | Separate binding | Separate binding |
| Clone a Target entity | Never | Never | Never |
Custom objects compare by identity, not by matching field contents. Save graphs preserve their resulting identity relationships across restart.