-
Notifications
You must be signed in to change notification settings - Fork 0
/
Maze.h
50 lines (41 loc) · 1.6 KB
/
Maze.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
44
45
46
47
48
49
50
#ifndef __MAZE_H_INCLUDED__
#define __MAZE_H_INCLUDED__
#include <stdbool.h>
#include "Common.h"
#include "Map.h"
typedef struct WayPoint {
Position pos;
struct WayPoint *links[4];
int linksum;
} WayPoint;
struct WayPointRouteData {
WayPoint **deadend;
int deadendElems;
WayPoint mostLongPair[2];
};
struct WayPointData {
int orgy;
int orgx;
int height;
int width;
int interval;
int elems;// *points の最大要素数。
WayPoint *points;
struct WayPointRouteData route;
};
/*-----------------------------------------------------------------------------
Maze: Prototype Extern Functions
---------------------------------------------------------------------------*/
extern unsigned int MazePathElems(int sy, int sx, int ey, int ex, int height, int width, int margin);
extern void MazeBuildPath(Position *path, int pathElems, int sy, int sx, int ey, int ex, int height, int width, int margin);
/* ウェイポイント */
extern int MazeInitWayPointData( struct WayPointData *way, int orgy, int orgx, int height, int width, int interval);
extern void MazeAllocWayPoints( struct WayPointData *way );
extern void MazeFreeWayPoints( struct WayPointData *way );
extern void MazeAllocDeadend( struct WayPointData *way );
extern void MazeFreeDeadend( struct WayPointData *way );
extern void MazeBuildWayPoints( struct WayPointData *way);
extern void MazeSaveDeadend( struct WayPointData *way );
extern int MazeFindMostLongRouteInDeadend( struct WayPointData *way, const int maxLimit );
extern void MazePrintWayPoint( WayPoint *point );
#endif/*__MAZE_H_INCLUDED__*/