2014-04-19 08:13:34 +02:00
|
|
|
#ifndef DB_LEVELDB_HEADER
|
|
|
|
#define DB_LEVELDB_HEADER
|
2014-03-05 21:41:27 +01:00
|
|
|
|
|
|
|
#include "db.h"
|
|
|
|
#include <leveldb/db.h>
|
|
|
|
|
|
|
|
class DBLevelDB : public DB {
|
|
|
|
public:
|
|
|
|
DBLevelDB(const std::string &mapdir);
|
2014-04-19 08:13:34 +02:00
|
|
|
virtual std::vector<BlockPos> getBlockPos();
|
|
|
|
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
|
2014-03-05 21:41:27 +01:00
|
|
|
~DBLevelDB();
|
|
|
|
private:
|
2014-03-28 21:47:19 +01:00
|
|
|
void loadPosCache();
|
|
|
|
|
2014-04-19 08:13:34 +02:00
|
|
|
std::vector<BlockPos> posCache;
|
2014-03-28 21:47:19 +01:00
|
|
|
|
2014-04-19 08:13:34 +02:00
|
|
|
leveldb::DB *db;
|
2014-03-05 21:41:27 +01:00
|
|
|
};
|
|
|
|
|
2014-04-19 08:13:34 +02:00
|
|
|
#endif // DB_LEVELDB_HEADER
|