Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 57 lines (42 sloc) 1.75 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
//
// ASIPath.h
// Part of ASIPathFinder --> http://allseeing-i.com/ASIPathFinder
//
// Created by Ben Copsey on 20/04/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
// An array of positions representing a path - objects use this to figure out where they are moving to next.
// A Path object is the output of ASISpaceTimePathFinder.
// For speed, it has a fixed size, which is not a problem for our purposes as each path will always be exactly the same length
// Rather than allocating

#import "ASIPathSearchDataTypes.h"

@interface ASIPath : NSObject {

// Pointer to the storage for our positions
Position3D *nodes;

// The length of this path
unsigned char length;

// Internal counter that records the point we are at while adding positions to the path
unsigned char writeCounter;

// Internal counter that records the point we are at while reading from the path
unsigned char readCounter;
}

// Create a path with a size
- (id)initWithPathSize:(int)size;

// Clear the path
- (void)clear;

// Add a position to the end of the path
- (void)addNode:(Position3D)newPosition;

// Add a position to the beginning of the path
- (void)insertNodeAtStart:(Position3D)newPosition;

// Get the first position in the path
- (Position3D)firstNode;

// Grab the position at a certain point in the path
// This is used by the team to find objects that may be in the way of this object
- (Position3D)nodeAtIndex:(unsigned int )index;

// Remove the first position in the path
- (void)removeFirstNode;

// The number of positions remaining in the path
- (unsigned int)length;

// Returns a position from a point in the path (primarily useful for debugging)
- (Position3D)positionAtIndex:(unsigned int)index;
@end
Something went wrong with that request. Please try again.