Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
dummymap.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton <jwmhjwmh@gmail.com>
4
5#pragma once
6
7#include "map.h"
8#include "mapsector.h"
9
10class DummyMap : public Map
11{
12public:
13 DummyMap(IGameDef *gamedef, v3s16 bpmin, v3s16 bpmax): Map(gamedef)
14 {
15 for (s16 z = bpmin.Z; z <= bpmax.Z; z++)
16 for (s16 x = bpmin.X; x <= bpmax.X; x++) {
17 v2s16 p2d(x, z);
18 MapSector *sector = new MapSector(this, p2d, gamedef);
19 m_sectors[p2d] = sector;
20 for (s16 y = bpmin.Y; y <= bpmax.Y; y++)
21 sector->createBlankBlock(y);
22 }
23 }
24
25 ~DummyMap() = default;
26
27 bool maySaveBlocks() override { return false; }
28};
Definition dummymap.h:11
DummyMap(IGameDef *gamedef, v3s16 bpmin, v3s16 bpmax)
Definition dummymap.h:13
bool maySaveBlocks() override
Definition dummymap.h:27
~DummyMap()=default
Definition gamedef.h:36
Definition mapsector.h:25
MapBlock * createBlankBlock(s16 y)
Definition mapsector.cpp:67
Definition map.h:101
std::unordered_map< v2s16, MapSector * > m_sectors
Definition map.h:282
core::vector2d< s16 > v2s16
Definition irr_v2d.h:12
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13