aystar.h
changeset 193 0a7025304867
parent 84 1e0721c29bad
child 1459 6c1f01803928
equal deleted inserted replaced
192:614bba52258d 193:0a7025304867
   105 	AyStar_CalculateG* CalculateG;
   105 	AyStar_CalculateG* CalculateG;
   106 	AyStar_CalculateH* CalculateH;
   106 	AyStar_CalculateH* CalculateH;
   107 	AyStar_GetNeighbours* GetNeighbours;
   107 	AyStar_GetNeighbours* GetNeighbours;
   108 	AyStar_EndNodeCheck* EndNodeCheck;
   108 	AyStar_EndNodeCheck* EndNodeCheck;
   109 	AyStar_FoundEndNode* FoundEndNode;
   109 	AyStar_FoundEndNode* FoundEndNode;
   110 	
   110 
   111 	/* These are completely untouched by AyStar, they can be accesed by
   111 	/* These are completely untouched by AyStar, they can be accesed by
   112 	 * the application specific routines to input and output data.
   112 	 * the application specific routines to input and output data.
   113 	 * user_path should typically contain data about the resulting path
   113 	 * user_path should typically contain data about the resulting path
   114 	 * afterwards, user_target should typically contain information about
   114 	 * afterwards, user_target should typically contain information about
   115 	 * what where looking for, and user_data can contain just about
   115 	 * what where looking for, and user_data can contain just about
   116 	 * everything */
   116 	 * everything */
   117 	void *user_path;
   117 	void *user_path;
   118 	void *user_target;
   118 	void *user_target;
   119 	uint user_data[10];
   119 	uint user_data[10];
   120 	
   120 
   121 	/* How many loops are there called before AyStarMain_Main gives
   121 	/* How many loops are there called before AyStarMain_Main gives
   122 	 * control back to the caller. 0 = until done */
   122 	 * control back to the caller. 0 = until done */
   123 	byte loops_per_tick;
   123 	byte loops_per_tick;
   124 	/* If the g-value goes over this number, it stops searching
   124 	/* If the g-value goes over this number, it stops searching
   125 	 *  0 = infinite */
   125 	 *  0 = infinite */
   126 	uint max_path_cost;
   126 	uint max_path_cost;
   127 	/* The maximum amount of nodes that will be expanded, 0 = infinite */
   127 	/* The maximum amount of nodes that will be expanded, 0 = infinite */
   128 	uint max_search_nodes; 
   128 	uint max_search_nodes;
   129 
   129 
   130 	/* These should be filled with the neighbours of a tile by
   130 	/* These should be filled with the neighbours of a tile by
   131 	 * GetNeighbours */
   131 	 * GetNeighbours */
   132 	AyStarNode neighbours[12];
   132 	AyStarNode neighbours[12];
   133 	byte num_neighbours;
   133 	byte num_neighbours;
   138 	AyStar_Main* main;
   138 	AyStar_Main* main;
   139 	AyStar_Loop* loop;
   139 	AyStar_Loop* loop;
   140 	AyStar_Free* free;
   140 	AyStar_Free* free;
   141 	AyStar_Clear* clear;
   141 	AyStar_Clear* clear;
   142 	AyStar_CheckTile* checktile;
   142 	AyStar_CheckTile* checktile;
   143 	
   143 
   144 	/* These will contain the open and closed lists */
   144 	/* These will contain the open and closed lists */
   145 
   145 
   146 	/* The actual closed list */
   146 	/* The actual closed list */
   147 	Hash ClosedListHash;
   147 	Hash ClosedListHash;
   148 	/* The open queue */
   148 	/* The open queue */
   162 
   162 
   163 /* Initialize an AyStar. You should fill all appropriate fields before
   163 /* Initialize an AyStar. You should fill all appropriate fields before
   164  * callling init_AyStar (see the declaration of AyStar for which fields are
   164  * callling init_AyStar (see the declaration of AyStar for which fields are
   165  * internal */
   165  * internal */
   166 void init_AyStar(AyStar* aystar, Hash_HashProc hash, uint num_buckets);
   166 void init_AyStar(AyStar* aystar, Hash_HashProc hash, uint num_buckets);
   167 	
   167 
   168 
   168 
   169 #endif
   169 #endif