Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

  1. #ifndef __SLVMAZE_H__
  2. #define __SLVMAZE_H__
  3. #define ANI_STATE_NONE 0
  4. #define ANI_STATE_TURN_TO 1
  5. #define ANI_STATE_TURN_AWAY 2
  6. #define ANI_STATE_FORWARD 3
  7. #define ANI_STATE_REVERSE 4
  8. #define SOL_DIR_LEFT 0
  9. #define SOL_DIR_UP 1
  10. #define SOL_DIR_RIGHT 2
  11. #define SOL_DIR_DOWN 3
  12. #define SOL_DIRS 4
  13. #define SOL_TURN_LEFT 0
  14. #define SOL_TURN_RIGHT 1
  15. typedef struct _MazeGoal
  16. {
  17. int clx, cly;
  18. void *user;
  19. } MazeGoal;
  20. typedef struct _MazeSolution
  21. {
  22. int clx, cly;
  23. int dir;
  24. Cell *maze;
  25. int w, h;
  26. MazeGoal *goals;
  27. int ngoals;
  28. int ani_state;
  29. int ani_count;
  30. int *turn_to;
  31. int *turn_away;
  32. int dir_sign;
  33. } MazeSolution;
  34. void SolveMazeStart(MazeView *vw,
  35. Cell *maze, int w, int h,
  36. IntPt2 *start, int start_dir,
  37. MazeGoal *goals, int ngoals,
  38. int turn_to,
  39. MazeSolution *sol);
  40. void SolveMazeSetGoals(MazeSolution *sol, MazeGoal *goals, int ngoals);
  41. MazeGoal *SolveMazeStep(MazeView *vw, MazeSolution *sol);
  42. #endif