-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAStar.h
43 lines (38 loc) · 1.07 KB
/
AStar.h
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
//
// AStar.h
// AStar
//
// Created by Mihails Tumkins on 11/29/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import "AStarConstants.h"
#import "AStarNode.h"
#import "AStarGrid.h"
#import <Foundation/Foundation.h>
@interface AStar : NSObject {
NSMutableArray * open;
NSMutableArray * closed;
NSMutableArray * path;
AStarGrid * grid;
double straightCost;
double diagonalCost;
heuristic heuristicType;
}
@property (nonatomic, retain) NSMutableArray * open;
@property (nonatomic, retain) NSMutableArray * closed;
@property (nonatomic, retain) NSMutableArray * path;
@property (nonatomic, retain) AStarGrid * grid;
@property double straightCost;
@property double diagonalCost;
@property heuristic heuristicType;
-(AStar *)initWithGrid:(AStarGrid *)g;
-(BOOL)findPath;
-(BOOL)search;
-(NSMutableArray *)buildPath;
-(double)getHeruistic:(AStarNode *)node;
-(double)manhattan:(AStarNode *)node;
-(double)euclidian:(AStarNode *)node;
-(double)diagonal:(AStarNode *)node;
-(BOOL)isOpen:(AStarNode *)node;
-(BOOL)isClosed:(AStarNode *)node;
@end