From 5001605391b220ca44d850a09bfe2cfa2c1b8ef8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Th=C3=A9ophyl?=
Date: Fri, 10 Dec 2021 14:18:10 +0100
Subject: [PATCH] moved struct on game.h + debug game equal
---
game.c | 7 -------
game.h | 7 +++++++
game_test_thoguet.c | 1 +
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/game.c b/game.c
index 524892f..b92e99c 100644
--- a/game.c
+++ b/game.c
@@ -2,13 +2,6 @@
#include
#include
-struct game_s {
- square** tab_cell;
- bool wrapped;
- uint height;
- uint width;
-};
-
game game_new(square* squares) {
game g = game_new_empty();
for (int i = 0; i < DEFAULT_SIZE; i++) {
diff --git a/game.h b/game.h
index 2206fb7..f43b87d 100644
--- a/game.h
+++ b/game.h
@@ -58,6 +58,13 @@ typedef enum {
/** square mask used in square enum */
#define A_MASK 0xFF
+struct game_s {
+ square** tab_cell;
+ bool wrapped;
+ uint height;
+ uint width;
+};
+
/**
* @brief The structure pointer that stores the game state.
**/
diff --git a/game_test_thoguet.c b/game_test_thoguet.c
index fc80d6c..99ca309 100644
--- a/game_test_thoguet.c
+++ b/game_test_thoguet.c
@@ -162,6 +162,7 @@ bool test_game_default_solution(void) {
game_set_square(g1, 5, 5, S_LIGHTBULB);
game_set_square(g1, 6, 1, S_LIGHTBULB);
game_update_flags(g1);
+ game_update_flags(g);
assert(game_equal(g, g1));
game_delete(g);
game_delete(g1);