-
-
Save glx22/02493484b52570a10b360d5dcd92fc65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Handlers and description of chunk. */ | |
struct ChunkHandler { | |
uint32 id; ///< Unique ID (4 letters). | |
ChunkSaveLoadProc *save_proc; ///< Save procedure of the chunk. | |
ChunkSaveLoadProc *load_proc; ///< Load procedure of the chunk. | |
ChunkSaveLoadProc *ptrs_proc; ///< Manipulate pointers in the chunk. | |
ChunkSaveLoadProc *load_check_proc; ///< Load procedure for game preview. | |
ChunkType type; ///< Type of the chunk. @see ChunkType | |
ChunkHandler(uint32 id, ChunkSaveLoadProc *save_proc, ChunkSaveLoadProc *load_proc, ChunkSaveLoadProc *ptrs_proc, ChunkSaveLoadProc *load_check_proc, ChunkType type) | |
: id(id), save_proc(save_proc), load_proc(load_proc), ptrs_proc(ptrs_proc), load_check_proc(load_check_proc), type(type) | |
{} | |
virtual ~ChunkHandler() {} | |
virtual void Save() { if (this->save_proc != nullptr) this->save_proc(); } | |
virtual void Load() { if (this->load_proc != nullptr) this->load_proc(); } | |
virtual void Pointers() { if (this->ptrs_proc != nullptr) this->ptrs_proc(); } | |
virtual void LoadCheck() { if (this->load_check_proc != nullptr) this->load_check_proc(); } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment