22 #ifndef AGS_PLUGINS_SERIALIZER_H 23 #define AGS_PLUGINS_SERIALIZER_H 25 #include "ags/shared/util/iags_stream.h" 26 #include "ags/plugins/ags_plugin.h" 27 #include "common/serializer.h" 39 _engine(engine), _file(file), _isLoading(isLoading) {}
41 bool isLoading()
const {
44 bool isSaving()
const {
49 void syncAsInt(T &value) {
52 _engine->FRead(buf, 4, _file);
53 value = READ_LE_INT32(buf);
55 WRITE_LE_UINT32(buf, value);
56 _engine->FWrite(buf, 4, _file);
60 void syncAsBool(
bool &value) {
62 _engine->FRead(&value, 1, _file);
64 _engine->FWrite(&value, 1, _file);
67 void syncAsInt8(int8 &value) {
69 _engine->FRead(&value, 1, _file);
71 _engine->FWrite(&value, 1, _file);
74 void syncAsByte(byte &value) {
76 _engine->FRead(&value, 1, _file);
78 _engine->FWrite(&value, 1, _file);
81 void syncAsFloat(
float &value) {
83 _engine->FRead(&value,
sizeof(
float), _file);
85 _engine->FWrite(&value,
sizeof(
float), _file);
88 void syncAsDouble(
double &value) {
90 _engine->FRead(&value,
sizeof(
double), _file);
92 _engine->FWrite(&value,
sizeof(
double), _file);
96 _engine->FSeek(-4, AGS::Shared::kSeekCurrent, _file);
Definition: serializer.h:32
Definition: ags_plugin.h:328