diff options
author | andrew <xdotftw@gmail.com> | 2014-01-20 15:10:39 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-01-20 15:10:39 +0100 |
commit | 7728f4bcbee7fa61f005c7b972685deb4bf04f2a (patch) | |
tree | 2aa40e20c9045a997abb25e17d2fa4890bf47e08 /src/WorldStorage/ScoreboardSerializer.h | |
parent | Scoreboard improvements (diff) | |
download | cuberite-7728f4bcbee7fa61f005c7b972685deb4bf04f2a.tar cuberite-7728f4bcbee7fa61f005c7b972685deb4bf04f2a.tar.gz cuberite-7728f4bcbee7fa61f005c7b972685deb4bf04f2a.tar.bz2 cuberite-7728f4bcbee7fa61f005c7b972685deb4bf04f2a.tar.lz cuberite-7728f4bcbee7fa61f005c7b972685deb4bf04f2a.tar.xz cuberite-7728f4bcbee7fa61f005c7b972685deb4bf04f2a.tar.zst cuberite-7728f4bcbee7fa61f005c7b972685deb4bf04f2a.zip |
Diffstat (limited to 'src/WorldStorage/ScoreboardSerializer.h')
-rw-r--r-- | src/WorldStorage/ScoreboardSerializer.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/WorldStorage/ScoreboardSerializer.h b/src/WorldStorage/ScoreboardSerializer.h new file mode 100644 index 000000000..2a4e0767e --- /dev/null +++ b/src/WorldStorage/ScoreboardSerializer.h @@ -0,0 +1,48 @@ + +// ScoreboardSerializer.h + +// Declares the cScoreboardSerializer class that is used for saving scoreboards into NBT format used by Anvil + + + + + +#pragma once + + + + + +// fwd: +class cFastNBTWriter; +class cParsedNBT; +class cScoreboard; + + + + +class cScoreboardSerializer +{ +public: + cScoreboardSerializer(const AString & a_WorldName, cScoreboard* a_ScoreBoard); + + /// Try to load the scoreboard + bool Load(void); + + /// Try to save the scoreboard + bool Save(void); + +private: + + void SaveScoreboardToNBT(cFastNBTWriter & a_Writer); + + bool LoadScoreboardFromNBT(const cParsedNBT & a_NBT); + + cScoreboard* m_ScoreBoard; + + AString m_Path; +} ; + + + + |