dummymap.h 655 B

1234567891011121314151617181920212223242526272829
  1. // Luanti
  2. // SPDX-License-Identifier: LGPL-2.1-or-later
  3. // Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton <jwmhjwmh@gmail.com>
  4. #pragma once
  5. #include "map.h"
  6. #include "mapsector.h"
  7. class DummyMap : public Map
  8. {
  9. public:
  10. DummyMap(IGameDef *gamedef, v3s16 bpmin, v3s16 bpmax): Map(gamedef)
  11. {
  12. for (s16 z = bpmin.Z; z <= bpmax.Z; z++)
  13. for (s16 x = bpmin.X; x <= bpmax.X; x++) {
  14. v2s16 p2d(x, z);
  15. MapSector *sector = new MapSector(this, p2d, gamedef);
  16. m_sectors[p2d] = sector;
  17. for (s16 y = bpmin.Y; y <= bpmax.Y; y++)
  18. sector->createBlankBlock(y);
  19. }
  20. }
  21. ~DummyMap() = default;
  22. bool maySaveBlocks() override { return false; }
  23. };