]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/map.h
Replace std::list by std::vector into ServerMap::listAllLoadableBlocks ServerMap...
[dragonfireclient.git] / src / map.h
index 70082d664518955858b23bde116bee9901c3f472..e2736d560ecaf12ff29c804dfd1c7fa10be0fbc8 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -80,9 +80,9 @@ struct MapEditEvent
 
        MapEditEvent():
                type(MEET_OTHER),
+               n(CONTENT_AIR),
                already_known_by_peer(0)
-       {
-       }
+       { }
 
        MapEditEvent * clone()
        {
@@ -189,7 +189,7 @@ class Map /*: public NodeContainer*/
        MapBlock * getBlockNoCreateNoEx(v3s16 p);
 
        /* Server overrides */
-       virtual MapBlock * emergeBlock(v3s16 p, bool allow_generate=true)
+       virtual MapBlock * emergeBlock(v3s16 p, bool create_blank=true)
        { return getBlockNoCreateNoEx(p); }
 
        // Returns InvalidPositionException if not found
@@ -267,9 +267,10 @@ class Map /*: public NodeContainer*/
 
        virtual void save(ModifiedState save_level){assert(0);};
 
-       // Server implements this.
-       // Client leaves it as no-op.
+       // Server implements these.
+       // Client leaves them as no-op.
        virtual bool saveBlock(MapBlock *block) { return false; };
+       virtual bool deleteBlock(v3s16 blockpos) { return false; };
 
        /*
                Updates usage timers and unloads unused blocks and sectors.
@@ -423,7 +424,7 @@ class ServerMap : public Map
                - Create blank filled with CONTENT_IGNORE
 
        */
-       MapBlock * emergeBlock(v3s16 p, bool create_blank=true);
+       MapBlock *emergeBlock(v3s16 p, bool create_blank=true);
 
        /*
                Try to get a block.
@@ -465,8 +466,8 @@ class ServerMap : public Map
        void endSave();
 
        void save(ModifiedState save_level);
-       void listAllLoadableBlocks(std::list<v3s16> &dst);
-       void listAllLoadedBlocks(std::list<v3s16> &dst);
+       void listAllLoadableBlocks(std::vector<v3s16> &dst);
+       void listAllLoadedBlocks(std::vector<v3s16> &dst);
        // Saves map seed and possibly other stuff
        void saveMapMeta();
        void loadMapMeta();
@@ -498,6 +499,8 @@ class ServerMap : public Map
        // Database version
        void loadBlock(std::string *blob, v3s16 p3d, MapSector *sector, bool save_after_load=false);
 
+       bool deleteBlock(v3s16 blockpos);
+
        void updateVManip(v3s16 pos);
 
        // For debug printing
@@ -535,11 +538,11 @@ class ServerMap : public Map
 #define VMANIP_BLOCK_DATA_INEXIST     1
 #define VMANIP_BLOCK_CONTAINS_CIGNORE 2
 
-class ManualMapVoxelManipulator : public VoxelManipulator
+class MMVManip : public VoxelManipulator
 {
 public:
-       ManualMapVoxelManipulator(Map *map);
-       virtual ~ManualMapVoxelManipulator();
+       MMVManip(Map *map);
+       virtual ~MMVManip();
 
        virtual void clear()
        {
@@ -551,11 +554,11 @@ class ManualMapVoxelManipulator : public VoxelManipulator
        {m_map = map;}
 
        void initialEmerge(v3s16 blockpos_min, v3s16 blockpos_max,
-                       bool load_if_inexistent = true);
+               bool load_if_inexistent = true);
 
        // This is much faster with big chunks of generated data
        void blitBackAll(std::map<v3s16, MapBlock*> * modified_blocks,
-                       bool overwrite_generated = true);
+               bool overwrite_generated = true);
 
        bool m_is_dirty;