CC3NodeArraySequencer Class Reference
Inherits from | CC3NodeSequencer : NSObject |
Declared in | CC3NodeSequencer.h |
Overview
An CC3NodeArraySequencer is a type of CC3NodeSequencer that arranges nodes into an array, and orders the nodes in the array by some criteria.
When a node is added, it is first evaluated by the contained evaluator. If it is accepted, the sequencer iterates through the existing nodes that it holds, invoking the template method shouldInsertNode:between:and:withVisitor: on each pair of sequential existing nodes, looking for the place to insert the new node. The node is inserted the first time that template method returns YES. If not suitable insertion point is found, the node is added to the end of the array.
This base class simply arranges the nodes in the order they are presented, by always adding to the end of the contained array of nodes. Subclasses will customize the way that the nodes are ordered and grouped in the array.
The contents of the nodes array are not copied when this sequencer is copied.
Instance Methods
shouldInsertNode:between:and:withVisitor:
Attempts to insert the specified node between two specified nodes that already exist in the array, and returns whether it was inserted at that location.
- (BOOL)shouldInsertNode:(CC3Node *)aNode between:(CC3Node *)leftNode and:(CC3Node *)rightNode withVisitor:(CC3NodeSequencerVisitor *)visitor
Discussion
This default implementation always returns NO, resulting in each node always being added to the end of the array.
Declared In
CC3NodeSequencer.h