1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Clean up database API and save the local map on an interval

This commit is contained in:
ShadowNinja 2014-11-16 15:31:57 -05:00
parent c7454d4732
commit 708337dfc2
16 changed files with 391 additions and 519 deletions

View file

@ -32,16 +32,22 @@ with this program; if not, write to the Free Software Foundation, Inc.,
class Database
{
public:
virtual void beginSave() = 0;
virtual void endSave() = 0;
virtual ~Database() {}
virtual void beginSave() {}
virtual void endSave() {}
virtual bool saveBlock(const v3s16 &pos, const std::string &data) = 0;
virtual std::string loadBlock(const v3s16 &pos) = 0;
virtual bool deleteBlock(const v3s16 &pos) = 0;
static s64 getBlockAsInteger(const v3s16 &pos);
static v3s16 getIntegerAsBlock(s64 i);
virtual bool saveBlock(v3s16 blockpos, std::string &data) = 0;
virtual std::string loadBlock(v3s16 blockpos) = 0;
virtual bool deleteBlock(v3s16 blockpos) = 0;
s64 getBlockAsInteger(const v3s16 pos) const;
v3s16 getIntegerAsBlock(s64 i) const;
virtual void listAllLoadableBlocks(std::vector<v3s16> &dst) = 0;
virtual int Initialized(void)=0;
virtual ~Database() {};
virtual bool initialized() const { return true; }
};
#endif