Public Member Functions | Static Public Member Functions | Protected Attributes

GamePaths Class Reference

Contains, manages and creates all Paths. More...

#import <GamePaths.h>

Collaboration diagram for GamePaths:
[legend]

List of all members.

Public Member Functions

(id) - init
 initializes class and returns an instance of the class, you must take care of allocating the object yourself
(void) - startPathForObject:touchLocation:
 begins drawing a path and assigns that path to the MovingObject once at least one more path points has been drawn
(void) - addPathPointsFromTouch:targets:
 tries to add a new path point, if the new path point is not far enough from the last point's position it will be ignored
(void) - endPath
 ends drawing the path, releases the object we're drawing the path for, changes line style if necessary
(void) - dealloc [implementation]
(void) - splitLineFrom:toPoint:pointArray: [implementation]
 this splits the line into smaller segments so that target points are not easily missed if the player draws a line quickly
(void) - addPathPointsForLineFrom:toPoint:targets: [implementation]

Static Public Member Functions

(id) + paths
 initializes class and returns an autoreleased instance of the class

Protected Attributes

PathdrawingPath
 this is the Path we're currently drawing
MovingObjectpathFollowObject
 only valid for the time a path is drawn, needed to check object states
CGPoint touchBeganLocation
 location where touch began, we need this as starting point for our path
bool isDrawingPath
 true if we're currently drawing a path

Detailed Description

Contains, manages and creates all Paths.

Creates a new Path and adds points to path as the player moves his finger. Ends or aborts path drawing as needed, eg. touch ended, path drawn is illegal (hit a collision) or path was drawn over endpoint (eg. landing strip or dock). Paths are drawn just above the GameHUD and below all GameObjects.


Member Function Documentation

- (void) addPathPointsForLineFrom: (CGPoint)  startPoint
toPoint: (CGPoint)  endPoint
targets: (TargetObjects*)  targets 
[implementation]
- (void) addPathPointsFromTouch: (CGPoint)  touchLocation
targets: (TargetObjects*)  targets 

tries to add a new path point, if the new path point is not far enough from the last point's position it will be ignored

- (void) dealloc   [implementation]
- (void) endPath  

ends drawing the path, releases the object we're drawing the path for, changes line style if necessary

- (id) init  

initializes class and returns an instance of the class, you must take care of allocating the object yourself

+ (id) paths  

initializes class and returns an autoreleased instance of the class

- (void) splitLineFrom: (CGPoint)  startPoint
toPoint: (CGPoint)  endPoint
pointArray: (NSMutableArray*)  points 
[implementation]

this splits the line into smaller segments so that target points are not easily missed if the player draws a line quickly

- (void) startPathForObject: (MovingObject*)  object
touchLocation: (CGPoint)  touchLocation 

begins drawing a path and assigns that path to the MovingObject once at least one more path points has been drawn


Member Data Documentation

- (Path*) drawingPath [protected]

this is the Path we're currently drawing

- (bool) isDrawingPath [protected]

true if we're currently drawing a path

- (MovingObject*) pathFollowObject [protected]

only valid for the time a path is drawn, needed to check object states

- (CGPoint) touchBeganLocation [protected]

location where touch began, we need this as starting point for our path


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Properties