Add LuaSecureRandom
[oweals/minetest.git] / src / database-dummy.h
index 5a6921370b46ab92f6894c77de0a0bf7e54c4146..0cf56928e08d314f2ad11edf5fcc172b106cbc0f 100644 (file)
@@ -1,26 +1,41 @@
+/*
+Minetest
+Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+
 #ifndef DATABASE_DUMMY_HEADER
 #define DATABASE_DUMMY_HEADER
 
-#include "map.h"
-#include "mapsector.h"
-#include "mapblock.h"
-#include "main.h"
-#include "filesys.h"
+#include <map>
+#include <string>
 #include "database.h"
+#include "irrlichttypes.h"
 
 class Database_Dummy : public Database
 {
 public:
-       Database_Dummy(ServerMap *map);
-       virtual void beginSave();
-       virtual void endSave();
-        virtual void saveBlock(MapBlock *block);
-        virtual MapBlock* loadBlock(v3s16 blockpos);
-        virtual void listAllLoadableBlocks(std::list<v3s16> &dst);
-        virtual int Initialized(void);
-       ~Database_Dummy();
+       virtual bool saveBlock(const v3s16 &pos, const std::string &data);
+       virtual std::string loadBlock(const v3s16 &pos);
+       virtual bool deleteBlock(const v3s16 &pos);
+       virtual void listAllLoadableBlocks(std::vector<v3s16> &dst);
+
 private:
-       ServerMap *srvmap;
-       std::map<unsigned long long, std::string> m_database;
+       std::map<s64, std::string> m_database;
 };
+
 #endif
+