-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsave_and_load.h
32 lines (25 loc) · 1.27 KB
/
save_and_load.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef SAVE_AND_LOAD_H
#define SAVE_AND_LOAD_H
#include "save_and_load.c"
/// @brief Function loads one of the saved games and edits the values of all the parameters:
/// @param config Configurations (width/height/highscores)
/// @param board board state
/// @param p1 p1 attributes
/// @param p2 p2 attributes
/// @param computer computer attributes
/// @param counter moves counter
/// @param mode mode (vs player = 1), vs computer = 2
void loadGame();
/// @brief function gets saved data from binary file to load
void getSavedData(configurations * saved_config, int * counter, int * mode, player * p1, player * p2, player * computer, int moves_stack[], char board[][saved_config->width]);
/// @brief Function saves the current board state and moves to a binary file
/// @param config Game configuration
/// @param board board state
/// @param p1 player one's attributes
/// @param p2 player two's attributes
/// @param computer computer's attributes
/// @param counter moves count
/// @param mode game-mode, 1 if vs player, 2 if vs computer
/// @param moves_stack // Array has all moves "columns" of the game (of both players)
void saveGame(configurations config, char board[][config.width], player p1, player p2, player computer, int *counter, int mode, int moves_stack[]);
#endif