Modify Class Definition, Swap Parents
MCDSP <class>; (<parent class>)n
- The name of the class being modified.
- The classes to be swapped in and out as parents of
<class>. Multiple parents are specified, separated by spaces or commas.
This is a CLI command that adds or removes one or more parents to
<class>. This means that all fields of a swapped in
<parent class> (including any fields that it inherits) will now be available to any node that is created from
<class>. Likewise, all fields of a swapped out
<parent class> (including any fields that it inherits) will now be removed from
<class>, with one exception -- if those fields are still valid from *other* parent classes of
<class>, or were already defined as a part of
<class>, then those fields will not be affected.
Any nodes that have already been created from
<class>, plus any nodes that are of a class that inherits from
<class> will be modified to include the new fields and exclude the removed fields. Any nodes that are currently loaded into the GOM will be modified immediately. Other nodes that are in storage will be modified when they are next loaded into the game.
If a node has the same field from multiple classes, it still only has one instance of that field. Adding classes does not duplicate fields -- it only adds fields that didn't already exist on the node. Fields that already existed and had data in them will not be affected. New fields will be added with a value of NULL.
Class parents may also be added and removed by using the Modify Class Definition, Add Parents (MCDAP) and Modify Class Definition, Remove Parents (MCDRP) commands. However these commands are atomic and as such may cause nodes to lose their field values if a field containing parent is removed and another with the same field is added. This Swap Parents command avoids this caveat by adding and removing the specified list of parents in one operation.
: MCDSP "fruit"; "saladbar" "botanical"