Instance Methods | List of all members
CC3NodeArraySequencer Class Reference

#import <CC3NodeSequencer.h>

Inheritance diagram for CC3NodeArraySequencer:
Inheritance graph

Instance Methods

(BOOL) - shouldInsertNode:between:and:withVisitor:
- Instance Methods inherited from CC3NodeSequencer
(BOOL) - add:withVisitor:
(NSString *) - fullDescription
(void) - identifyMisplacedNodesWithVisitor:
(id) - initWithEvaluator:
(void) - populateFrom:
(BOOL) - remove:withVisitor:
(BOOL) - updateSequenceWithVisitor:
(void) - visitNodesWithNodeVisitor:

Additional Inherited Members

- Class Methods inherited from CC3NodeSequencer
(id) + sequencer
(id) + sequencerWithEvaluator:
- Properties inherited from CC3NodeSequencer
BOOL allowSequenceUpdates
NSArray * nodes
BOOL shouldUseOnlyForwardDistance

Detailed Description

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.

Method Documentation

- (BOOL) shouldInsertNode: (CC3Node *)  aNode
between: (CC3Node *)  leftNode
and: (CC3Node *)  rightNode
withVisitor: (CC3NodeSequencerVisitor *)  visitor 

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.

This default implementation always returns NO, resulting in each node always being added to the end of the array.

The documentation for this class was generated from the following file: