X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmapsector.h;h=4c1ce86a3ac6077412f58ed7546e42a478539873;hb=8658c8d9b5f30dc952eed29a19d619de9210474c;hp=4f2b3f31feb35acf3a555f51ba3168ded618d52b;hpb=6a1670dbc31cc0e44178bbd9ad34ff0d5981a060;p=minetest.git diff --git a/src/mapsector.h b/src/mapsector.h index 4f2b3f31f..4c1ce86a3 100644 --- a/src/mapsector.h +++ b/src/mapsector.h @@ -20,14 +20,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef MAPSECTOR_HEADER #define MAPSECTOR_HEADER -#include -#include "irrlichttypes_bloated.h" -#include "exceptions.h" +#include "irrlichttypes.h" +#include "irr_v2d.h" +#include "mapblock.h" #include #include -#include +#include -class MapBlock; class Map; class IGameDef; @@ -41,7 +40,7 @@ class IGameDef; class MapSector { public: - + MapSector(Map *parent, v2s16 pos, IGameDef *gamedef); virtual ~MapSector(); @@ -59,16 +58,18 @@ class MapSector MapBlock * createBlankBlock(s16 y); void insertBlock(MapBlock *block); - + void deleteBlock(MapBlock *block); - - void getBlocks(std::list &dest); - + + void getBlocks(MapBlockVect &dest); + + bool empty(); + // Always false at the moment, because sector contains no metadata. bool differs_from_disk; protected: - + // The pile of MapBlocks std::map m_blocks; @@ -77,12 +78,12 @@ class MapSector v2s16 m_pos; IGameDef *m_gamedef; - + // Last-used block is cached here for quicker access. - // Be sure to set this to NULL when the cached block is deleted + // Be sure to set this to NULL when the cached block is deleted MapBlock *m_block_cache; s16 m_block_cache_y; - + /* Private methods */ @@ -95,7 +96,7 @@ class ServerMapSector : public MapSector public: ServerMapSector(Map *parent, v2s16 pos, IGameDef *gamedef); ~ServerMapSector(); - + u32 getId() const { return MAPSECTOR_SERVER; @@ -107,7 +108,7 @@ class ServerMapSector : public MapSector */ void serialize(std::ostream &os, u8 version); - + static ServerMapSector* deSerialize( std::istream &is, Map *parent, @@ -115,7 +116,7 @@ class ServerMapSector : public MapSector std::map & sectors, IGameDef *gamedef ); - + private: }; @@ -125,7 +126,7 @@ class ClientMapSector : public MapSector public: ClientMapSector(Map *parent, v2s16 pos, IGameDef *gamedef); ~ClientMapSector(); - + u32 getId() const { return MAPSECTOR_CLIENT; @@ -134,6 +135,6 @@ class ClientMapSector : public MapSector private: }; #endif - + #endif