Skip to content

Commit e108fc5

Browse files
author
Shota Aoki
authored
STEP8 MapManagerのリファクタリング (#11)
* MapManagerの関数宣言と実装の順番をそろえる * 未使用の関数を削除。 map_manager内でしか使用しない関数をprivateに変更
1 parent 9b21391 commit e108fc5

File tree

2 files changed

+174
-198
lines changed

2 files changed

+174
-198
lines changed

uROS_STEP8_micromouse/map_manager.h

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,34 @@ typedef struct
3030

3131
class MapManager
3232
{
33-
private:
34-
unsigned short steps_map[MAZESIZE_X][MAZESIZE_Y]; //歩数マップ
35-
t_wall wall[MAZESIZE_X][MAZESIZE_Y]; //壁の情報を格納する構造体配列
36-
t_position mypos;
37-
short goal_mx, goal_my;
38-
3933
public:
40-
void view(char view_weight_f);
41-
// unsigned short *GET_WALL_POINTER(void);
34+
MapManager();
35+
4236
void positionInit(void);
43-
void setMyPos(char x, char y, t_direction_glob dir);
4437
void setMyPosDir(t_direction_glob dir);
4538
short getMyPosX(void);
4639
short getMyPosY(void);
47-
t_direction_glob getMyPosDir(void);
4840
char getWallData(unsigned char x, unsigned char y, t_direction_glob dir);
4941
void setWallData(unsigned char x, unsigned char y, t_direction_glob dir, char data);
50-
unsigned short getStepMapData(unsigned char x, unsigned char y);
5142
char getGoalX(void);
5243
char getGoalY(void);
5344
void setGoalX(short data);
5445
void setGoalY(short data);
55-
56-
void makeMap2(int x, int y);
57-
void makeSearchMap(int x, int y);
58-
t_direction getNextDir2(short x, short y, t_direction_glob * dir);
59-
t_direction getNextDir(char x, char y, t_direction_glob * dir);
6046
void axisUpdate(void);
6147
void nextDir(t_direction dir);
62-
void wallch(int x, int y, int x2, int y2);
6348
void setWall(bool IS_SEN_FR, bool IS_SEN_R, bool IS_SEN_L);
64-
int getPriority(unsigned char x, unsigned char y, t_direction_glob dir);
49+
t_direction getNextDir(char x, char y, t_direction_glob * dir);
50+
t_direction getNextDir2(short x, short y, t_direction_glob * dir);
6551

66-
MapManager();
52+
private:
53+
unsigned short steps_map[MAZESIZE_X][MAZESIZE_Y]; //歩数マップ
54+
t_wall wall[MAZESIZE_X][MAZESIZE_Y]; //壁の情報を格納する構造体配列
55+
t_position mypos;
56+
short goal_mx, goal_my;
57+
58+
void makeMap2(int x, int y);
59+
void makeSearchMap(int x, int y);
60+
int getPriority(unsigned char x, unsigned char y, t_direction_glob dir);
6761
};
6862

6963
#endif // MAP_MANAGER_H_

0 commit comments

Comments
 (0)