Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
dummymap.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton <jwmhjwmh@gmail.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
22#include "map.h"
23#include "mapsector.h"
24
25class DummyMap : public Map
26{
27public:
28 DummyMap(IGameDef *gamedef, v3s16 bpmin, v3s16 bpmax): Map(gamedef)
29 {
30 for (s16 z = bpmin.Z; z <= bpmax.Z; z++)
31 for (s16 x = bpmin.X; x <= bpmax.X; x++) {
32 v2s16 p2d(x, z);
33 MapSector *sector = new MapSector(this, p2d, gamedef);
34 m_sectors[p2d] = sector;
35 for (s16 y = bpmin.Y; y <= bpmax.Y; y++)
36 sector->createBlankBlock(y);
37 }
38 }
39
40 ~DummyMap() = default;
41
42 bool maySaveBlocks() override { return false; }
43};
Definition dummymap.h:26
DummyMap(IGameDef *gamedef, v3s16 bpmin, v3s16 bpmax)
Definition dummymap.h:28
bool maySaveBlocks() override
Definition dummymap.h:42
~DummyMap()=default
Definition gamedef.h:51
Definition mapsector.h:40
MapBlock * createBlankBlock(s16 y)
Definition mapsector.cpp:82
Definition map.h:116
std::unordered_map< v2s16, MapSector * > m_sectors
Definition map.h:297
core::vector2d< s16 > v2s16
Definition irr_v2d.h:27
core::vector3d< s16 > v3s16
Definition irr_v3d.h:28