MapNode - políčko mapy | |
Mapa je dvojrozměrné pole uzlů (políček). Jedno políčko je reprezentováno strukturou MapNode: | |
typedef struct _MapNode { Position Pos; // position int TC; // terrain cost int Owner; // tile owner number short int FootSteps; // how many footsteps are crossing this tile // temporary data for findpath // tags int Steps; peTime Time; int f; // best find cost to get here from the start tile int g; // estimated cost to get from here to the end tile int o; // f+g = total tile cost Position CameFrom; // heap int SearchID; int HeapPos; // 0 = is not in heap } MapNode; |
|
Terrain cost (TC) určuje obtížnost průchodu políčkem. Pokud se TC==MAXTC, pak je políčko neprůchodné a nedá se na něj vstoupit. | |
V případě,že na políčku stojí Walker. Bude proměnná Owner naplněna jeho indexem. V opačné případě bude -1. | |
FootSteps určuje kolik Walkerů má naplánovanou cestu přes toto políčko. | |
Dále jsou zde pomocné proměnné vyhrazené pro A-star algoritmus. Viz. použitý algoritmus. |