diff options
Diffstat (limited to 'src/database.h')
-rw-r--r-- | src/database.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/database.h b/src/database.h index 0cf75232f..5a2b844fd 100644 --- a/src/database.h +++ b/src/database.h @@ -20,22 +20,24 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef DATABASE_HEADER #define DATABASE_HEADER -#include <vector> #include <string> +#include <vector> #include "irr_v3d.h" #include "irrlichttypes.h" - -#ifndef PP - #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" -#endif +#include "util/basic_macros.h" class Database { public: - virtual ~Database() {} + virtual void beginSave() = 0; + virtual void endSave() = 0; + virtual bool initialized() const { return true; } +}; - virtual void beginSave() {} - virtual void endSave() {} +class MapDatabase : public Database +{ +public: + virtual ~MapDatabase() {} virtual bool saveBlock(const v3s16 &pos, const std::string &data) = 0; virtual void loadBlock(const v3s16 &pos, std::string *block) = 0; @@ -45,9 +47,19 @@ public: static v3s16 getIntegerAsBlock(s64 i); virtual void listAllLoadableBlocks(std::vector<v3s16> &dst) = 0; +}; - virtual bool initialized() const { return true; } +class PlayerSAO; +class RemotePlayer; + +class PlayerDatabase +{ +public: + virtual ~PlayerDatabase() {} + virtual void savePlayer(RemotePlayer *player) = 0; + virtual bool loadPlayer(RemotePlayer *player, PlayerSAO *sao) = 0; + virtual bool removePlayer(const std::string &name) = 0; + virtual void listPlayers(std::vector<std::string> &res) = 0; }; #endif - |