implementation of history in struct game and fcts
This commit is contained in:
1 parent
256556e1f8
commit
b48d52bb6b
3 files changed
+7
-1
No files matched your search
@@ -36,6 +36,7 @@ game game_new_empty(void) {
|
||||
g->wrapped = false;
|
||||
g->height = DEFAULT_SIZE;
|
||||
g->width = DEFAULT_SIZE;
|
||||
g->hist = NULL;
|
||||
return g;
|
||||
}
|
||||
|
||||
@@ -69,6 +70,9 @@ void game_delete(game g) {
|
||||
free(g->tab_cell);
|
||||
if (g->tab_cell != NULL)
|
||||
g->tab_cell = NULL;
|
||||
history_delete_entire_history(g->hist);
|
||||
if (g->hist != NULL)
|
||||
g->hist = NULL;
|
||||
free(g);
|
||||
if (g != NULL)
|
||||
g = NULL;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#ifndef __GAME_H__
|
||||
#define __GAME_H__
|
||||
#include <stdbool.h>
|
||||
#include "history.h"
|
||||
|
||||
/**
|
||||
* @brief Standard unsigned integer type.
|
||||
@@ -63,6 +64,7 @@ struct game_s {
|
||||
bool wrapped;
|
||||
uint height;
|
||||
uint width;
|
||||
history hist;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user