helapordo 1.4.12
Loading...
Searching...
No Matches
ser_core.h File Reference
#include <inttypes.h>
#include "../utils/game_utils.h"
Include dependency graph for ser_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SerSaveHeader
 Serialized save header. More...
 
struct  SaveHeader
 Save header. More...
 
struct  SerTurncounter
 Serialized Turncounter. More...
 
struct  SerPerk
 Serialized Perk. More...
 
struct  SerSkillslot
 Serialized Skillslot. More...
 
struct  SerEquip
 Serialized Equip. More...
 
struct  SerEquipslot
 Serialized Equipslot. More...
 
struct  SerSpecialslot
 Serialized Specialslot. More...
 
struct  SerConsumable
 Serialized Consumable. More...
 
struct  SerArtifact
 Serialized Artifact. More...
 
struct  SerCountstats
 Serialized countStats. More...
 
struct  SerEnemy
 Serialized Enemy. More...
 
struct  SerBoss
 Serialized Boss. More...
 
struct  SerFighter
 Serialized Fighter. More...
 
struct  SerFoeParty
 Serialized FoeParty. More...
 
struct  SerChest
 Serialized Chest. More...
 
struct  SerTreasure
 Serialized Treasure. More...
 
struct  SerShop
 Serialized Shop. More...
 
struct  SerRoadfork
 Serialized Roadfork. More...
 
struct  SerRoom
 Serialized Room. More...
 
struct  SerFloor
 Serialized Floor. More...
 
struct  SerWincon
 Serialized Wincon. More...
 
struct  SerSaveslot
 Serialized Saveslot. More...
 
struct  SerPath
 Serialized SerPath. More...
 
struct  SerGamestate
 Serialized Gamestate. More...
 
struct  SerGameOptions
 Serialized GameOptions. More...
 

Macros

#define SERSAVEHEADER_BUFSIZE   15
 Defines size for all SerSaveHeader char buffers.
 
#define SAVEHEADER_BUFSIZE   SERSAVEHEADER_BUFSIZE
 Defines size for all SaveHeader char buffers.
 
#define SerTurncounter_Fmt   "SerTurncounter { Type: %" PRId32 ", Count: %" PRId32 ", InnerValue: %" PRId32 " }"
 
#define SerTurncounter_Arg(st)
 
#define SerPerk_Fmt   "SerPerk { Class: %s , InnerValue: %" PRId32 " }"
 
#define SerPerk_Arg(sp)
 
#define SerEquip_Fmt   "SerEquip { Class: %s , Type: %s, Equipped: %" PRId8 ", Level: %" PRId8 ", Atk: %" PRId8 ", Def: %" PRId8 ", Vel: %" PRId8 ", Enr: %" PRId8 ", Bonus: %" PRId8 ", PerksCount: %" PRId8 ", Cost: %" PRId8 ", Quality: %s }"
 
#define SerEquip_Arg(se)
 
#define SerSpecialslot_Fmt   "SerSpecialslot { Move: %" PRId8 ", Enabled: %s, Cost: %" PRId8 " }"
 
#define SerSpecialslot_Arg(sp)
 
#define SerConsumable_Fmt   "SerConsumable { Class: %s , Quantity: %" PRId32 " }"
 
#define SerConsumable_Arg(sc)
 
#define SerArtifact_Fmt   "SerArtifact { Class: %s , Quantity: %" PRId32 ", Active: %" PRId32 ", InnerValue: %" PRId32 " }"
 
#define SerArtifact_Arg(sa)
 
#define SerCountstats_Fmt   "SerCountstats {\n Enemies killed: %" PRId8 ",\n Consumables Found: %" PRId8 ",\n Equips Found: %" PRId8 ",\n Artifacts found: %" PRId8 ",\n Critical Hits dealt: %" PRId8",\n Rooms completed: %" PRId8 ",\n Floors completed: %" PRId8 ",\n Specials Unlocked: %" PRId8 ",\n Coins found: %" PRId8 ",\n Bosses killed: %" PRId8 ",\n Unique Bosses Killed: %" PRId8 ",\n Killed Bosses: [\n %s: %s,\n %s: %s,\n %s: %s,\n %s: %s,\n %s: %s\n ],\n Keys Found: %" PRId8 "\n }"
 
#define SerCountstats_Arg(sc)
 
#define SERFIGHTER_NAME_BUFSIZE   FIGHTER_NAME_BUFSIZE
 Defines size for SerFighter name buffer.
 
#define SerFighter_Fmt   "SerFighter {\n Name: %s,\n Class: %s,\n Hp: %" PRId8 ",\n Atk: %" PRId8 ",\n Def: %" PRId8 ",\n Vel: %" PRId8 ",\n Level: %" PRId8 ",\n Luck: %" PRId8 ",\n Total xp: %" PRId8 ",\n Current lvl xp: %" PRId8 ",\n Total lvl xp: %" PRId8 ",\n Total hp: %" PRId8 ",\n Status: %s,\n Energy: %" PRId8 ",\n Total energy: %" PRId8 ",\n Stamina: %" PRId8 ",\n Total Stamina: %" PRId8 ",\n Turnboost_Atk: %" PRId8 ",\n Turnboost_Def: %" PRId8 ",\n Turnboost_Vel: %" PRId8 ",\n Turnboost_Enr: %" PRId8 ",\n PerksCount: %" PRId8 ",\n EquipsBagOccupiedSlots: %" PRId8 ",\n EarliestBagSlot: %" PRId8 ",\n Permboost_Atk: %" PRId8 ",\n Permboost_Def: %" PRId8 ",\n Permboost_Vel: %" PRId8 ",\n Permboost_Enr: %" PRId8 ",\n Equipboost_Atk: %" PRId8 ",\n Equipboost_Def: %" PRId8 ",\n Equipboost_Vel: %" PRId8 ",\n Equipboost_Enr: %" PRId8 ",\n Balance: %" PRId32 ",\n Keys Balance: %" PRId8 ",\n Floor_x: %" PRId8 ",\n Floor_y: %" PRId8 "\n }"
 
#define SerFighter_Arg(sf)
 
#define SERPATH_SEED_BUFSIZE   PATH_SEED_BUFSIZE
 

Typedefs

typedef struct SerSaveHeader SerSaveHeader
 Serialized save header.
 
typedef struct SaveHeader SaveHeader
 Save header.
 
typedef struct SerTurncounter SerTurncounter
 Serialized Turncounter.
 
typedef struct SerPerk SerPerk
 Serialized Perk.
 
typedef struct SerSkillslot SerSkillslot
 Serialized Skillslot.
 
typedef struct SerEquip SerEquip
 Serialized Equip.
 
typedef struct SerEquipslot SerEquipslot
 Serialized Equipslot.
 
typedef struct SerSpecialslot SerSpecialslot
 Serialized Specialslot.
 
typedef struct SerConsumable SerConsumable
 Serialized Consumable.
 
typedef struct SerArtifact SerArtifact
 Serialized Artifact.
 
typedef struct SerCountstats SerCountstats
 Serialized countStats.
 
typedef struct SerEnemy SerEnemy
 Serialized Enemy.
 
typedef struct SerBoss SerBoss
 Serialized Boss.
 
typedef struct SerFighter SerFighter
 Serialized Fighter.
 
typedef struct SerFoeParty SerFoeParty
 Serialized FoeParty.
 
typedef struct SerChest SerChest
 Serialized Chest.
 
typedef struct SerTreasure SerTreasure
 Serialized Treasure.
 
typedef struct SerShop SerShop
 Serialized Shop.
 
typedef struct SerRoadfork SerRoadfork
 Serialized Roadfork.
 
typedef struct SerRoom SerRoom
 Serialized Room.
 
typedef struct SerFloor SerFloor
 Serialized Floor.
 
typedef struct SerWincon SerWincon
 Serialized Wincon.
 
typedef struct SerSaveslot SerSaveslot
 Serialized Saveslot.
 
typedef struct SerPath SerPath
 Serialized SerPath.
 
typedef struct SerGamestate SerGamestate
 Serialized Gamestate.
 
typedef struct SerGameOptions SerGameOptions
 Serialized GameOptions.
 

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)
 

Macro Definition Documentation

◆ SAVEHEADER_BUFSIZE

#define SAVEHEADER_BUFSIZE   SERSAVEHEADER_BUFSIZE

Defines size for all SaveHeader char buffers.

See also
SaveHeader

◆ SerArtifact_Arg

#define SerArtifact_Arg ( sa)
Value:
(stringFromArtifacts(sa.class)), (sa.qty), (sa.active), (sa.innerValue)
char * stringFromArtifacts(int a)
Takes a integer and returns the corresponding artifact string by the inner array position.
Definition game_utils.c:1556

◆ SerArtifact_Fmt

#define SerArtifact_Fmt   "SerArtifact { Class: %s , Quantity: %" PRId32 ", Active: %" PRId32 ", InnerValue: %" PRId32 " }"

◆ SerConsumable_Arg

#define SerConsumable_Arg ( sc)
Value:
(stringFromConsumables(sc.class)), (sc.qty)
char * stringFromConsumables(int c)
Takes a integer and returns the corresponding consumable string by the inner array position.
Definition game_utils.c:1504

◆ SerConsumable_Fmt

#define SerConsumable_Fmt   "SerConsumable { Class: %s , Quantity: %" PRId32 " }"

◆ SerCountstats_Arg

#define SerCountstats_Arg ( sc)
Value:
(sc.enemieskilled), (sc.consumablesfound), (sc.equipsfound), (sc.artifactsfound), (sc.criticalhits), (sc.roomscompleted), (sc.floorscompleted), (sc.specialsunlocked), (sc.coinsfound), (sc.bosseskilled), (sc.unique_bosseskilled), (stringFromBossClass(0)), (sc.killed_bosses[0] >= 1 ? "True" : "False"), (stringFromBossClass(1)), (sc.killed_bosses[1] >= 1 ? "True" : "False"), (stringFromBossClass(2)), (sc.killed_bosses[2] >= 1 ? "True" : "False"), (stringFromBossClass(3)), (sc.killed_bosses[3] >= 1 ? "True" : "False"), (stringFromBossClass(4)), (sc.killed_bosses[4] >= 1 ? "True" : "False"), (sc.keysfound)
char * stringFromBossClass(bossClass b)
Takes a bossClass and returns the corresponding string by the inner array position.
Definition game_utils.c:1491

◆ SerCountstats_Fmt

#define SerCountstats_Fmt   "SerCountstats {\n Enemies killed: %" PRId8 ",\n Consumables Found: %" PRId8 ",\n Equips Found: %" PRId8 ",\n Artifacts found: %" PRId8 ",\n Critical Hits dealt: %" PRId8",\n Rooms completed: %" PRId8 ",\n Floors completed: %" PRId8 ",\n Specials Unlocked: %" PRId8 ",\n Coins found: %" PRId8 ",\n Bosses killed: %" PRId8 ",\n Unique Bosses Killed: %" PRId8 ",\n Killed Bosses: [\n %s: %s,\n %s: %s,\n %s: %s,\n %s: %s,\n %s: %s\n ],\n Keys Found: %" PRId8 "\n }"

◆ SerEquip_Arg

#define SerEquip_Arg ( se)
Value:
(stringFromEquips(se.class)), (stringFromEquipzones(se.type)), (se.equipped), (se.level), (se.atk), (se.def), (se.vel), (se.enr), (se.bonus), (se.perksCount), (se.cost), (stringFromQuality(se.qual))
char * stringFromQuality(int q)
Takes a integer and returns the corresponding quality string by the inner array position.
Definition game_utils.c:1543
char * stringFromEquipzones(int z)
Takes a integer and returns the corresponding equipzone string by the inner array position.
Definition game_utils.c:1530
char * stringFromEquips(int e)
Takes a integer and returns the corresponding equip string by the inner array position.
Definition game_utils.c:1517

◆ SerEquip_Fmt

#define SerEquip_Fmt   "SerEquip { Class: %s , Type: %s, Equipped: %" PRId8 ", Level: %" PRId8 ", Atk: %" PRId8 ", Def: %" PRId8 ", Vel: %" PRId8 ", Enr: %" PRId8 ", Bonus: %" PRId8 ", PerksCount: %" PRId8 ", Cost: %" PRId8 ", Quality: %s }"

◆ SerFighter_Arg

#define SerFighter_Arg ( sf)
Value:
(sf.name), (stringFromClass(sf.class)), (sf.hp), (sf.atk), (sf.def), (sf.vel), (sf.level), (sf.luck), (sf.totalxp), (sf.currentlevelxp), (sf.totallevelxp), (sf.totalhp), (stringFromStatus(sf.status)), (sf.energy), (sf.totalenergy), (sf.stamina), (sf.totalstamina), (sf.turnboost_atk), (sf.turnboost_def), (sf.turnboost_vel), (sf.turnboost_enr), (sf.perksCount), (sf.equipsBagOccupiedSlots), (sf.earliestBagSlot), (sf.permboost_atk), (sf.permboost_def), (sf.permboost_vel), (sf.permboost_enr), (sf.equipboost_atk), (sf.equipboost_def), (sf.equipboost_vel), (sf.equipboost_enr), (sf.balance), (sf.keys_balance), (sf.floor_x), (sf.floor_y)
char * stringFromStatus(fighterStatus s)
Takes a fighterStatus and returns the corresponding string by the inner array position.
Definition game_utils.c:1431
char * stringFromClass(fighterClass f)
Takes a fighterClass and returns the corresponding string by the inner array position.
Definition game_utils.c:1465

◆ SerFighter_Fmt

#define SerFighter_Fmt   "SerFighter {\n Name: %s,\n Class: %s,\n Hp: %" PRId8 ",\n Atk: %" PRId8 ",\n Def: %" PRId8 ",\n Vel: %" PRId8 ",\n Level: %" PRId8 ",\n Luck: %" PRId8 ",\n Total xp: %" PRId8 ",\n Current lvl xp: %" PRId8 ",\n Total lvl xp: %" PRId8 ",\n Total hp: %" PRId8 ",\n Status: %s,\n Energy: %" PRId8 ",\n Total energy: %" PRId8 ",\n Stamina: %" PRId8 ",\n Total Stamina: %" PRId8 ",\n Turnboost_Atk: %" PRId8 ",\n Turnboost_Def: %" PRId8 ",\n Turnboost_Vel: %" PRId8 ",\n Turnboost_Enr: %" PRId8 ",\n PerksCount: %" PRId8 ",\n EquipsBagOccupiedSlots: %" PRId8 ",\n EarliestBagSlot: %" PRId8 ",\n Permboost_Atk: %" PRId8 ",\n Permboost_Def: %" PRId8 ",\n Permboost_Vel: %" PRId8 ",\n Permboost_Enr: %" PRId8 ",\n Equipboost_Atk: %" PRId8 ",\n Equipboost_Def: %" PRId8 ",\n Equipboost_Vel: %" PRId8 ",\n Equipboost_Enr: %" PRId8 ",\n Balance: %" PRId32 ",\n Keys Balance: %" PRId8 ",\n Floor_x: %" PRId8 ",\n Floor_y: %" PRId8 "\n }"

◆ SERFIGHTER_NAME_BUFSIZE

#define SERFIGHTER_NAME_BUFSIZE   FIGHTER_NAME_BUFSIZE

Defines size for SerFighter name buffer.

See also
SerFighter

◆ SERPATH_SEED_BUFSIZE

#define SERPATH_SEED_BUFSIZE   PATH_SEED_BUFSIZE

◆ SerPerk_Arg

#define SerPerk_Arg ( sp)
Value:
(nameStringFromPerk(sp.class)), (sp.innerValue)
char * nameStringFromPerk(int p)
Takes a integer and returns the corresponding perk name string by the inner array position.
Definition game_utils.c:1651

◆ SerPerk_Fmt

#define SerPerk_Fmt   "SerPerk { Class: %s , InnerValue: %" PRId32 " }"

◆ SERSAVEHEADER_BUFSIZE

#define SERSAVEHEADER_BUFSIZE   15

Defines size for all SerSaveHeader char buffers.

See also
SerSaveHeader

◆ SerSpecialslot_Arg

#define SerSpecialslot_Arg ( sp)
Value:
(sp.move), (sp.enabled >= 1 ? "True" : "False"), (sp.cost)

◆ SerSpecialslot_Fmt

#define SerSpecialslot_Fmt   "SerSpecialslot { Move: %" PRId8 ", Enabled: %s, Cost: %" PRId8 " }"

◆ SerTurncounter_Arg

#define SerTurncounter_Arg ( st)
Value:
(st.type), (st.count), (st.innerValue)

◆ SerTurncounter_Fmt

#define SerTurncounter_Fmt   "SerTurncounter { Type: %" PRId32 ", Count: %" PRId32 ", InnerValue: %" PRId32 " }"

Typedef Documentation

◆ SaveHeader

typedef struct SaveHeader SaveHeader

Save header.

Normal struct. Can be obtained from a SerSaveHeader with deser_SaveHeader().

See also
deser_SaveHeader()
SerSaveHeader

◆ SerArtifact

typedef struct SerArtifact SerArtifact

Serialized Artifact.

Packed struct. Can be turned into a Artifact with deser_Artifact(). Can be obtained from an Artifact with ser_Artifact().

See also
Artifact
deser_Artifact()
ser_Artifact()

◆ SerBoss

typedef struct SerBoss SerBoss

Serialized Boss.

Packed struct. Can be turned into an Boss with deser_Boss(). Can be obtained from a Boss with ser_Boss().

See also
Boss
deser_Boss()
ser_Boss()

◆ SerChest

typedef struct SerChest SerChest

Serialized Chest.

Packed struct. Can be turned into a Chest with deser_Chest(). Can be obtained from a Chest with ser_Chest().

See also
Chest
deser_Chest()
ser_Chest()

◆ SerConsumable

typedef struct SerConsumable SerConsumable

Serialized Consumable.

Packed struct. Can be turned into a Consumable with deser_Consumable(). Can be obtained from a Consumable with ser_Consumable().

See also
Consumable
deser_Consumable()
ser_Consumable()

◆ SerCountstats

typedef struct SerCountstats SerCountstats

Serialized countStats.

Packed struct. Can be turned into a countStats with deser_countStats(). Can be obtained from a countStats with ser_countStats().

See also
countStats
deser_countStats()
ser_countStats()

◆ SerEnemy

typedef struct SerEnemy SerEnemy

Serialized Enemy.

Packed struct. Can be turned into an Enemy with deser_Enemy(). Can be obtained from a Enemy with ser_Enemy().

See also
Enemy
deser_Enemy()
ser_Enemy()

◆ SerEquip

typedef struct SerEquip SerEquip

Serialized Equip.

Packed struct. Can be turned into an Equip with deser_Equip(). Can be obtained from an Equip with ser_Equip().

See also
Equip
deser_Equip()
ser_Equip()

◆ SerEquipslot

typedef struct SerEquipslot SerEquipslot

Serialized Equipslot.

Packed struct. Can be turned into an Equipslot with deser_Equipslot(). Can be obtained from an Equipslot with ser_Equipslot().

See also
Equipslot
deser_Equipslot()
ser_Equipslot()

◆ SerFighter

typedef struct SerFighter SerFighter

Serialized Fighter.

Packed struct. Can be turned into an Fighter with deser_Fighter(). Can be obtained from a Fighter with ser_Fighter().

See also
Fighter
deser_Fighter()
ser_Fighter()

◆ SerFloor

typedef struct SerFloor SerFloor

Serialized Floor.

Packed struct. Can be turned into a Floor with deser_Floor(). Can be obtained from a Floor with ser_Floor().

See also
Floor
deser_Floor()
ser_Floor()

◆ SerFoeParty

typedef struct SerFoeParty SerFoeParty

Serialized FoeParty.

Packed struct. Can be turned into an FoeParty with deser_FoeParty(). Can be obtained from a FoeParty with ser_FoeParty().

See also
FoeParty
deser_FoeParty()
ser_FoeParty()

◆ SerGameOptions

typedef struct SerGameOptions SerGameOptions

Serialized GameOptions.

Packed struct. Can be turned into a GameOptions with deser_GameOptions(). Can be obtained from a GameOptions with ser_GameOptions().

See also
SerGameOptions
deser_GameOptions()
ser_GameOptions()

◆ SerGamestate

typedef struct SerGamestate SerGamestate

Serialized Gamestate.

Packed struct. Can be turned into a Gamestate with deser_Gamestate(). Can be obtained from a Gamestate with ser_Gamestate().

See also
Gamestate
deser_Gamestate()
ser_Gamestate()

◆ SerPath

typedef struct SerPath SerPath

Serialized SerPath.

Packed struct. Can be turned into a Path with deser_Path(). Can be obtained from a Path with ser_Path().

See also
Path
deser_Path()
ser_Path()

◆ SerPerk

typedef struct SerPerk SerPerk

Serialized Perk.

Packed struct. Can be turned into a Perk with deser_Perk(). Can be obtained from a Perk with ser_Perk().

See also
Perk
deser_Perk()
ser_Perk()

◆ SerRoadfork

typedef struct SerRoadfork SerRoadfork

Serialized Roadfork.

Packed struct. Can be turned into a Roadfork with deser_Roadfork(). Can be obtained from a Roadfork with ser_Roadfork().

See also
Roadfork
deser_Roadfork()
ser_Roadfork()

◆ SerRoom

typedef struct SerRoom SerRoom

Serialized Room.

Packed struct. Can be turned into a Room with deser_Room(). Can be obtained from a Room with ser_Room().

See also
Room
deser_Room()
ser_Room()

◆ SerSaveHeader

typedef struct SerSaveHeader SerSaveHeader

Serialized save header.

Packed struct. Can be turned into a SaveHeader with deser_SaveHeader().

See also
deser_SaveHeader()

◆ SerSaveslot

typedef struct SerSaveslot SerSaveslot

Serialized Saveslot.

Packed struct. Can be turned into a Saveslot with deser_Saveslot(). Can be obtained from a Saveslot with ser_Saveslot().

See also
Saveslot
deser_Saveslot()
ser_Saveslot()

◆ SerShop

typedef struct SerShop SerShop

Serialized Shop.

Packed struct. Can be turned into a Shop with deser_Shop(). Can be obtained from a Shop with ser_Shop().

See also
Shop
deser_Shop()

◆ SerSkillslot

typedef struct SerSkillslot SerSkillslot

Serialized Skillslot.

Packed struct. Can be turned into a Skillslot with deser_Skillslot(). Can be obtained from a Skillslot with ser_Skillslot().

See also
Skillslot
deser_Skillslot()
ser_Skillslot()

◆ SerSpecialslot

typedef struct SerSpecialslot SerSpecialslot

Serialized Specialslot.

Packed struct. Can be turned into a Specialslot with deser_Specialslot(). Can be obtained from a Specialslot with ser_Speciaslot().

See also
Specialslot
deser_Specialslot()
ser_Specialslot()

◆ SerTreasure

typedef struct SerTreasure SerTreasure

Serialized Treasure.

Packed struct. Can be turned into a Treasure with deser_Treasure(). Can be obtained from a Treasure with ser_Treasure().

See also
Treasure
deser_Treasure()
ser_Treasure()

◆ SerTurncounter

typedef struct SerTurncounter SerTurncounter

Serialized Turncounter.

Packed struct. Can be turned into a Turncounter with deser_turnCounter(). Can be obtained from a Turncounter with ser_turnCounter().

See also
Turncounter
deser_turnCounter()
ser_turnCounter()

◆ SerWincon

typedef struct SerWincon SerWincon

Serialized Wincon.

Packed struct. Can be turned into a Wincon with deser_Wincon(). Can be obtained from a Wincon with ser_Wincon().

See also
Wincon
deser_Wincon()
ser_Wincon()

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