All Data Structures Files Functions Variables Enumerations Enumerator Properties Defines
Public Member Functions | Protected Attributes
TreeState Class Reference

#import <TreeState.h>

Inheritance diagram for TreeState:
State

Public Member Functions

(void) - addChild:
(CCArray *) - getChildren
(void) - setAsLeafNode:
(void) - setParent:
(BOOL) - isLeaf
(BOOL) - isEqualTo:
(Action- getAction
(void) - setAction:
(CCArray *) - buildRoute:
(CCArray *) - buildRoutes:
(void) - printStructure

Protected Attributes

int nodeValue
Action action
TreeStateparent
CCArray * children

Detailed Description

Definition at line 16 of file TreeState.h.


Member Function Documentation

- (void) addChild: (TreeState*)  _state

Adds a child node

Parameters:
thestate to add

Definition at line 42 of file TreeState.m.

- (CCArray *) buildRoute: (CCArray*)  _route

Recursively builds an array with the tree nodes

Returns:
the array

Definition at line 176 of file TreeState.m.

- (CCArray *) buildRoutes: (CCArray*)  _routes

Recursively builds the structure

Definition at line 190 of file TreeState.m.

Gets the action which leads to this state

Returns:
the action

Definition at line 142 of file TreeState.m.

- (CCArray *) getChildren

Returns the child nodes

Returns:
The children as a CCArray

Definition at line 124 of file TreeState.m.

- (BOOL) isEqualTo: (TreeState*)  _state

Compares the gameobjects/actions to determine if the states are the same

Parameters:
thestate to compare
Returns:
a BOOL representation

Definition at line 106 of file TreeState.m.

- (BOOL) isLeaf

If the node value's 1 or -1, it's a leaf

Returns:
the above as a BOOL

Definition at line 94 of file TreeState.m.

- (void) printStructure

Recursively prints the structure

Definition at line 205 of file TreeState.m.

- (void) setAction: (Action _action

Sets the action which leads to this state

Parameters:
theaction to set

Definition at line 133 of file TreeState.m.

- (void) setAsLeafNode: (CharacterStates _state

Sets the nodeValue according to the passed state

Parameters:
thecurrent state

Definition at line 63 of file TreeState.m.

- (void) setParent: (TreeState*)  _parent

Sets the parent node

Parameters:
theparent

Definition at line 85 of file TreeState.m.


Field Documentation

- (Action) action [protected]

Definition at line 20 of file TreeState.h.

- (CCArray*) children [protected]

Definition at line 23 of file TreeState.h.

- (int) nodeValue [protected]

Definition at line 19 of file TreeState.h.

- (TreeState*) parent [protected]

Definition at line 22 of file TreeState.h.


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