#ifndef H_SAVE #define H_SAVE #include #include #include #include "logic.h" // The save contents, after the version has been checked and the security undone struct save_contents { bool lamp_on; time_t last_time; // The last time the game was exited time_t start_time; time_t lamp_switch_time; }; // Generates a save void gen_save_data(struct save_contents *save, const struct game_state *state); // Loads `save` into `state` void load_save_data(const struct save_contents *save, struct game_state *state); // Returns true on success bool save(const struct save_contents *save); // Returns true if the file is valid or missing, // false if there is an existing file that is invalid // If no save is found or the file is invalid, // the default save file will be loaded bool load_save(struct save_contents *save); void get_default_save(struct save_contents *save); #endif