X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fdatabase.h;h=45978930691013f27b25158e85e67aa916ef0236;hb=d0ce27edd8e9a30330c81a69ccca52b02056c286;hp=79cabe6a31c37c96ec5d7a7952124bf621a68961;hpb=95e4a93b1bb98eb94b4ca00fb73a0162bd5c8c0e;p=oweals%2Fminetest.git diff --git a/src/database.h b/src/database.h index 79cabe6a3..459789306 100644 --- a/src/database.h +++ b/src/database.h @@ -20,23 +20,31 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef DATABASE_HEADER #define DATABASE_HEADER -#include +#include +#include #include "irr_v3d.h" - -class MapBlock; +#include "irrlichttypes.h" +#include "util/basic_macros.h" class Database { public: - virtual void beginSave()=0; - virtual void endSave()=0; - - virtual void saveBlock(MapBlock *block)=0; - virtual MapBlock* loadBlock(v3s16 blockpos)=0; - long long getBlockAsInteger(const v3s16 pos); - v3s16 getIntegerAsBlock(long long i); - virtual void listAllLoadableBlocks(std::list &dst)=0; - virtual int Initialized(void)=0; - virtual ~Database() {}; + virtual ~Database() {} + + virtual void beginSave() {} + virtual void endSave() {} + + virtual bool saveBlock(const v3s16 &pos, const std::string &data) = 0; + virtual void loadBlock(const v3s16 &pos, std::string *block) = 0; + virtual bool deleteBlock(const v3s16 &pos) = 0; + + static s64 getBlockAsInteger(const v3s16 &pos); + static v3s16 getIntegerAsBlock(s64 i); + + virtual void listAllLoadableBlocks(std::vector &dst) = 0; + + virtual bool initialized() const { return true; } }; + #endif +