00001 00006 /* 00007 Originally written by Justin-Heyes Jones 00008 Modified by Shlomi Fish, 2000 00009 Modified by Florian Festi, 2007 00010 00011 This file is in the public domain (it's uncopyrighted). 00012 00013 Check out Justin-Heyes Jones' A* page from which this code has 00014 originated: 00015 http://www.geocities.com/jheyesjones/astar.html 00016 */ 00017 00018 #ifndef __PQUEUE_H 00019 #define __PQUEUE_H 00020 00021 #include "../shared/shared.h" 00022 00029 typedef int priorityQueueRating_t; 00030 00031 typedef struct priorityQueueElement_s { 00032 pos4_t item; 00033 priorityQueueRating_t rating; 00034 } priorityQueueElement_t; 00035 00040 typedef struct priorityQueue_s { 00041 uint32_t maxSize; 00042 uint32_t currentSize; 00043 priorityQueueElement_t *elements; 00044 } priorityQueue_t; 00045 00046 void PQueueInitialise(priorityQueue_t *pq, uint32_t maxElements); 00047 void PQueueFree(priorityQueue_t *pq); 00048 00049 #define PQueueIsEmpty(pq) ((pq)->currentSize == 0) 00050 void PQueuePush(priorityQueue_t *pq, pos4_t item, priorityQueueRating_t rating); 00051 void PQueuePop(priorityQueue_t *pq, pos4_t item); 00052 00053 #endif /* #ifdef __PQUEUE_H */