helapordo 1.4.12
Loading...
Searching...
No Matches
ser_core.c File Reference
#include "ser_core.h"
Include dependency graph for ser_core.c:

Functions

bool writeSerSaveHeader (const char *filename, SerSaveHeader *data)
 Writes passed SerSaveHeader to passed file path.
 
bool readSerSaveHeader (const char *filename, SerSaveHeader *data)
 Reads SerSaveHeader from passed file path into passed structure.
 
bool deser_SaveHeader (SerSaveHeader *ser, SaveHeader *deser)
 Converts passed SerSaveHeader into a SaveHeader.
 
SaveHeaderprep_saveHeader (const char *static_path, Koliseo *kls, bool force_init, bool *did_init, int saveslot_index)
 Tries reading binary save from passed path.
 
bool appendSerTurncounter (const char *filename, SerTurncounter *data)
 
bool readSerTurncounter (const char *filename, size_t offset, SerTurncounter *data)
 
bool deser_Turncounter (SerTurncounter *ser, Turncounter *deser)
 
bool ser_Turncounter (Turncounter *deser, SerTurncounter *ser)
 
bool deser_Perk (SerPerk *ser, Perk *deser)
 
bool ser_Perk (Perk *deser, SerPerk *ser)
 
bool deser_Skillslot (SerSkillslot *ser, Skillslot *deser)
 
bool ser_Skillslot (Skillslot *deser, SerSkillslot *ser)
 
bool deser_Equip (SerEquip *ser, Equip *deser)
 
bool ser_Equip (Equip *deser, SerEquip *ser)
 
bool deser_Equipslot (SerEquipslot *ser, Equipslot *deser)
 
bool ser_Equipslot (Equipslot *deser, SerEquipslot *ser)
 
bool deser_Specialslot (SerSpecialslot *ser, Specialslot *deser)
 
bool ser_Specialslot (Specialslot *deser, SerSpecialslot *ser)
 
bool deser_Consumable (SerConsumable *ser, Consumable *deser)
 
bool ser_Consumable (Consumable *deser, SerConsumable *ser)
 
bool deser_Artifact (SerArtifact *ser, Artifact *deser)
 
bool ser_Artifact (Artifact *deser, SerArtifact *ser)
 
bool deser_countStats (SerCountstats *ser, countStats *deser)
 
bool ser_countStats (countStats *deser, SerCountstats *ser)
 
bool deser_Enemy (SerEnemy *ser, Enemy *deser)
 
bool ser_Enemy (Enemy *deser, SerEnemy *ser)
 
bool deser_Boss (SerBoss *ser, Boss *deser)
 
bool ser_Boss (Boss *deser, SerBoss *ser)
 
bool deser_Fighter (SerFighter *ser, Fighter *deser)
 
bool ser_Fighter (Fighter *deser, SerFighter *ser)
 
bool deser_FoeParty (SerFoeParty *ser, FoeParty *deser)
 
bool ser_FoeParty (FoeParty *deser, SerFoeParty *ser)
 
bool deser_Chest (SerChest *ser, Chest *deser)
 
bool ser_Chest (Chest *deser, SerChest *ser)
 
bool deser_Treasure (SerTreasure *ser, Treasure *deser)
 
bool ser_Treasure (Treasure *deser, SerTreasure *ser)
 
bool deser_Shop (SerShop *ser, Shop *deser)
 
bool ser_Shop (Shop *deser, SerShop *ser)
 
bool deser_Roadfork (SerRoadfork *ser, Roadfork *deser)
 
bool ser_Roadfork (Roadfork *deser, SerRoadfork *ser)
 
bool deser_Room (SerRoom *ser, Room *deser)
 
bool ser_Room (Room *deser, SerRoom *ser)
 
bool deser_Floor (SerFloor *ser, Floor *deser)
 
bool ser_Floor (Floor *deser, SerFloor *ser)
 
bool deser_Wincon (SerWincon *ser, Wincon *deser)
 
bool ser_Wincon (Wincon *deser, SerWincon *ser)
 
bool deser_Saveslot (SerSaveslot *ser, Saveslot *deser)
 
bool ser_Saveslot (Saveslot *deser, SerSaveslot *ser)
 
bool deser_Path (SerPath *ser, Path *deser)
 
bool ser_Path (Path *deser, SerPath *ser)
 
bool writeSerGamestate (const char *filename, SerGamestate *data)
 
bool appendSerGamestate (const char *filename, SerGamestate *data)
 
bool readSerGamestate (const char *filename, size_t offset, SerGamestate *data)
 
bool deser_Gamestate (SerGamestate *ser, Gamestate *deser)
 
bool ser_Gamestate (Gamestate *deser, SerGamestate *ser)
 
bool prep_Gamestate (Gamestate *gmst, const char *static_path, size_t offset, Koliseo *kls, bool force_init)
 Tries reading binary gamestate from passed path, at passed offset.
 
bool read_savedir (const char *dirpath)
 
bool deser_GameOptions (SerGameOptions *ser, GameOptions *deser)
 
bool ser_GameOptions (GameOptions *deser, SerGameOptions *ser)
 
bool writeSerGameOptions (const char *filename, SerGameOptions *data)
 
bool appendSerGameOptions (const char *filename, SerGameOptions *data)
 
bool readSerGameOptions (const char *filename, size_t offset, SerGameOptions *data)
 
bool prep_GameOptions (GameOptions *game_options, const char *static_path, size_t offset, Koliseo *kls, bool force_init)
 

Function Documentation

◆ appendSerGameOptions()

bool appendSerGameOptions ( const char * filename,
SerGameOptions * data )

◆ appendSerGamestate()

bool appendSerGamestate ( const char * filename,
SerGamestate * data )

◆ appendSerTurncounter()

bool appendSerTurncounter ( const char * filename,
SerTurncounter * data )

◆ deser_Artifact()

bool deser_Artifact ( SerArtifact * ser,
Artifact * deser )

◆ deser_Boss()

bool deser_Boss ( SerBoss * ser,
Boss * deser )

◆ deser_Chest()

bool deser_Chest ( SerChest * ser,
Chest * deser )

◆ deser_Consumable()

bool deser_Consumable ( SerConsumable * ser,
Consumable * deser )

◆ deser_countStats()

bool deser_countStats ( SerCountstats * ser,
countStats * deser )

◆ deser_Enemy()

bool deser_Enemy ( SerEnemy * ser,
Enemy * deser )

◆ deser_Equip()

bool deser_Equip ( SerEquip * ser,
Equip * deser )

◆ deser_Equipslot()

bool deser_Equipslot ( SerEquipslot * ser,
Equipslot * deser )

◆ deser_Fighter()

bool deser_Fighter ( SerFighter * ser,
Fighter * deser )

◆ deser_Floor()

bool deser_Floor ( SerFloor * ser,
Floor * deser )

◆ deser_FoeParty()

bool deser_FoeParty ( SerFoeParty * ser,
FoeParty * deser )

◆ deser_GameOptions()

bool deser_GameOptions ( SerGameOptions * ser,
GameOptions * deser )

◆ deser_Gamestate()

bool deser_Gamestate ( SerGamestate * ser,
Gamestate * deser )

◆ deser_Path()

bool deser_Path ( SerPath * ser,
Path * deser )

◆ deser_Perk()

bool deser_Perk ( SerPerk * ser,
Perk * deser )

◆ deser_Roadfork()

bool deser_Roadfork ( SerRoadfork * ser,
Roadfork * deser )

◆ deser_Room()

bool deser_Room ( SerRoom * ser,
Room * deser )

◆ deser_SaveHeader()

bool deser_SaveHeader ( SerSaveHeader * ser,
SaveHeader * deser )

Converts passed SerSaveHeader into a SaveHeader.

Parameters
serThe SerSaveHeader to convert.
deserThe SaveHeader destination.
See also
SerSaveHeader
SaveHeader
Returns
True on success

◆ deser_Saveslot()

bool deser_Saveslot ( SerSaveslot * ser,
Saveslot * deser )

◆ deser_Shop()

bool deser_Shop ( SerShop * ser,
Shop * deser )

◆ deser_Skillslot()

bool deser_Skillslot ( SerSkillslot * ser,
Skillslot * deser )

◆ deser_Specialslot()

bool deser_Specialslot ( SerSpecialslot * ser,
Specialslot * deser )

◆ deser_Treasure()

bool deser_Treasure ( SerTreasure * ser,
Treasure * deser )

◆ deser_Turncounter()

bool deser_Turncounter ( SerTurncounter * ser,
Turncounter * deser )

◆ deser_Wincon()

bool deser_Wincon ( SerWincon * ser,
Wincon * deser )

◆ prep_GameOptions()

bool prep_GameOptions ( GameOptions * game_options,
const char * static_path,
size_t offset,
Koliseo * kls,
bool force_init )

◆ prep_Gamestate()

bool prep_Gamestate ( Gamestate * gmst,
const char * static_path,
size_t offset,
Koliseo * kls,
bool force_init )

Tries reading binary gamestate from passed path, at passed offset.

Parameters
gmstPointer to Gamestate.
static_pathThe path to which we append to find our file.
offsetThe offset of the SerGameState into passed file.
klsKoliseo used for allocation.
force_initUsed to force writing a new SerGamestate.
See also
SerGamestate
Gamestate
Returns
The newly allocated Gamestate. TODO Contract should meaningfully capture case of read failure + init.

◆ prep_saveHeader()

SaveHeader * prep_saveHeader ( const char * static_path,
Koliseo * kls,
bool force_init,
bool * did_init,
int saveslot_index )

Tries reading binary save from passed path.

Parameters
static_pathThe path to which we append to find our file.
klsKoliseo used for allocation.
force_initWhen true, forces the write of a new SerSaveHeader.
did_initSet to true when a new saveHeader is written.
saveslot_indexUsed to pass current saveslot index.
See also
SerSaveHeader
SaveHeader
Returns
The newly allocated SaveHeader. TODO Contract should meaningfully capture case of read failure + init.

◆ read_savedir()

bool read_savedir ( const char * dirpath)

◆ readSerGameOptions()

bool readSerGameOptions ( const char * filename,
size_t offset,
SerGameOptions * data )

◆ readSerGamestate()

bool readSerGamestate ( const char * filename,
size_t offset,
SerGamestate * data )

◆ readSerSaveHeader()

bool readSerSaveHeader ( const char * filename,
SerSaveHeader * data )

Reads SerSaveHeader from passed file path into passed structure.

Parameters
filenameThe path to read from.
dataThe structure to read into.
See also
SerSaveHeader
Returns
True on success

◆ readSerTurncounter()

bool readSerTurncounter ( const char * filename,
size_t offset,
SerTurncounter * data )

◆ ser_Artifact()

bool ser_Artifact ( Artifact * deser,
SerArtifact * ser )

◆ ser_Boss()

bool ser_Boss ( Boss * deser,
SerBoss * ser )

◆ ser_Chest()

bool ser_Chest ( Chest * deser,
SerChest * ser )

◆ ser_Consumable()

bool ser_Consumable ( Consumable * deser,
SerConsumable * ser )

◆ ser_countStats()

bool ser_countStats ( countStats * deser,
SerCountstats * ser )

◆ ser_Enemy()

bool ser_Enemy ( Enemy * deser,
SerEnemy * ser )

◆ ser_Equip()

bool ser_Equip ( Equip * deser,
SerEquip * ser )

◆ ser_Equipslot()

bool ser_Equipslot ( Equipslot * deser,
SerEquipslot * ser )

◆ ser_Fighter()

bool ser_Fighter ( Fighter * deser,
SerFighter * ser )

◆ ser_Floor()

bool ser_Floor ( Floor * deser,
SerFloor * ser )

◆ ser_FoeParty()

bool ser_FoeParty ( FoeParty * deser,
SerFoeParty * ser )

◆ ser_GameOptions()

bool ser_GameOptions ( GameOptions * deser,
SerGameOptions * ser )

◆ ser_Gamestate()

bool ser_Gamestate ( Gamestate * deser,
SerGamestate * ser )

◆ ser_Path()

bool ser_Path ( Path * deser,
SerPath * ser )

◆ ser_Perk()

bool ser_Perk ( Perk * deser,
SerPerk * ser )

◆ ser_Roadfork()

bool ser_Roadfork ( Roadfork * deser,
SerRoadfork * ser )

◆ ser_Room()

bool ser_Room ( Room * deser,
SerRoom * ser )

◆ ser_Saveslot()

bool ser_Saveslot ( Saveslot * deser,
SerSaveslot * ser )

◆ ser_Shop()

bool ser_Shop ( Shop * deser,
SerShop * ser )

◆ ser_Skillslot()

bool ser_Skillslot ( Skillslot * deser,
SerSkillslot * ser )

◆ ser_Specialslot()

bool ser_Specialslot ( Specialslot * deser,
SerSpecialslot * ser )

◆ ser_Treasure()

bool ser_Treasure ( Treasure * deser,
SerTreasure * ser )

◆ ser_Turncounter()

bool ser_Turncounter ( Turncounter * deser,
SerTurncounter * ser )

◆ ser_Wincon()

bool ser_Wincon ( Wincon * deser,
SerWincon * ser )

◆ writeSerGameOptions()

bool writeSerGameOptions ( const char * filename,
SerGameOptions * data )

◆ writeSerGamestate()

bool writeSerGamestate ( const char * filename,
SerGamestate * data )

◆ writeSerSaveHeader()

bool writeSerSaveHeader ( const char * filename,
SerSaveHeader * data )

Writes passed SerSaveHeader to passed file path.

Parameters
filenameThe path to write to.
dataThe structure to write.
See also
SerSaveHeader
Returns
True on success