From 0f2ee4f9a293224bb614a91b4c3777a28eeaf7b6 Mon Sep 17 00:00:00 2001 From: Joe Lukas Kalb Date: Tue, 6 Feb 2024 18:45:26 +0100 Subject: [PATCH] refactoring: State --> Field_State --- src/main/c/global.h | 2 +- src/main/c/labyrinth.c | 2 +- src/main/c/labyrinth.h | 2 +- src/test/c/test_labyrinth.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/c/global.h b/src/main/c/global.h index 1dea8db..6da861c 100644 --- a/src/main/c/global.h +++ b/src/main/c/global.h @@ -7,6 +7,6 @@ typedef enum { typedef enum { WAY, WALL, SOLUTION -} State; +} Field_State; #endif \ No newline at end of file diff --git a/src/main/c/labyrinth.c b/src/main/c/labyrinth.c index 7b13e6e..71ccb5c 100644 --- a/src/main/c/labyrinth.c +++ b/src/main/c/labyrinth.c @@ -43,7 +43,7 @@ void lab_move(unsigned short *x, unsigned short *y, Direction direction){ } -void set_wall(State** field, unsigned short x, unsigned short y) { +void set_wall(Field_State** field, unsigned short x, unsigned short y) { field[0][0] = WALL; } diff --git a/src/main/c/labyrinth.h b/src/main/c/labyrinth.h index 15cd364..5b789f4 100644 --- a/src/main/c/labyrinth.h +++ b/src/main/c/labyrinth.h @@ -5,6 +5,6 @@ void turn_direction_right(Direction *direction); void lab_move(unsigned short *x, unsigned short *y, Direction direction); -void set_wall(State** field, unsigned short x, unsigned short y); +void set_wall(Field_State** field, unsigned short x, unsigned short y); #endif // TEST_H diff --git a/src/test/c/test_labyrinth.c b/src/test/c/test_labyrinth.c index f950838..9ef1074 100644 --- a/src/test/c/test_labyrinth.c +++ b/src/test/c/test_labyrinth.c @@ -207,7 +207,7 @@ void test_set_wall_at_0_0_expected_WALL(void) unsigned short y = 0; unsigned short len_x = 1, len_y = 1; - State **field; + Field_State **field; field = malloc(len_x * sizeof *field); for (int c_index = 0; c_index < len_x; c_index++){ @@ -216,7 +216,7 @@ void test_set_wall_at_0_0_expected_WALL(void) field[x][y] = WAY; - State expected = WALL; + Field_State expected = WALL; /* act */ set_wall(field, x, y);