Skip to content

Commit

Permalink
STEP12 MapManagerのリファクタリング (#17)
Browse files Browse the repository at this point in the history
* MapManagerの未使用関数を削除

* MapManagerクラスの関数定義と実装の順番を変更
  • Loading branch information
ShotaAk committed Jun 19, 2023
1 parent 5e2567e commit 3048ee0
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 190 deletions.
30 changes: 13 additions & 17 deletions uROS_STEP12_micromouse/map_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,35 @@ typedef struct

class MapManager
{
private:
unsigned short steps_map[MAZESIZE_X][MAZESIZE_Y]; //歩数マップ
t_wall wall[MAZESIZE_X][MAZESIZE_Y]; //壁の情報を格納する構造体配列
t_position mypos;
short goal_mx, goal_my;

public:
void view(char view_weight_f);
MapManager();

void positionInit(void);
void setMyPos(char x, char y, t_direction_glob dir);
void setMyPosDir(t_direction_glob dir);
short getMyPosX(void);
short getMyPosY(void);
t_direction_glob getMyPosDir(void);
char getWallData(unsigned char x, unsigned char y, t_direction_glob dir);
void setWallData(unsigned char x, unsigned char y, t_direction_glob dir, char data);
unsigned short getStepMapData(unsigned char x, unsigned char y);
char getGoalX(void);
char getGoalY(void);
void setGoalX(short data);
void setGoalY(short data);

void makeMap2(int x, int y);
void makeSearchMap(int x, int y);
t_direction getNextDir2(short x, short y, t_direction_glob * dir);
t_direction getNextDir(char x, char y, t_direction_glob * dir);
void axisUpdate(void);
void nextDir(t_direction dir);
void wallch(int x, int y, int x2, int y2);
void setWall(bool IS_SEN_FR, bool IS_SEN_R, bool IS_SEN_L);
int getPriority(unsigned char x, unsigned char y, t_direction_glob dir);
t_direction getNextDir(char x, char y, t_direction_glob * dir);
t_direction getNextDir2(short x, short y, t_direction_glob * dir);

MapManager();
private:
unsigned short steps_map[MAZESIZE_X][MAZESIZE_Y]; //歩数マップ
t_wall wall[MAZESIZE_X][MAZESIZE_Y]; //壁の情報を格納する構造体配列
t_position mypos;
short goal_mx, goal_my;

void makeSearchMap(int x, int y);
void makeMap2(int x, int y);
int getPriority(unsigned char x, unsigned char y, t_direction_glob dir);
};

#endif // MAP_MANAGER_H_
Loading

0 comments on commit 3048ee0

Please sign in to comment.