Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
reflowscan.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2016 MillersMan <millersman@users.noreply.github.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 "util/container.h"
24
25class NodeDefManager;
26class Map;
27class MapBlock;
28
30public:
31 ReflowScan(Map *map, const NodeDefManager *ndef);
32 void scan(MapBlock *block, UniqueQueue<v3s16> *liquid_queue);
33
34private:
35 MapBlock *lookupBlock(int x, int y, int z);
36 bool isLiquidFlowableTo(int x, int y, int z);
37 bool isLiquidHorizontallyFlowable(int x, int y, int z);
38 void scanColumn(int x, int z);
39
40private:
41 Map *m_map = nullptr;
42 const NodeDefManager *m_ndef = nullptr;
45 MapBlock *m_lookup[3 * 3 * 3];
47};
Definition: mapblock.h:73
Definition: map.h:116
This class is for getting the actual properties of nodes from their content ID.
Definition: nodedef.h:556
Definition: reflowscan.h:29
u32 m_lookup_state_bitset
Definition: reflowscan.h:46
void scanColumn(int x, int z)
Definition: reflowscan.cpp:115
bool isLiquidFlowableTo(int x, int y, int z)
Definition: reflowscan.cpp:85
UniqueQueue< v3s16 > * m_liquid_queue
Definition: reflowscan.h:44
const NodeDefManager * m_ndef
Definition: reflowscan.h:42
MapBlock * m_lookup[3 *3 *3]
Definition: reflowscan.h:45
Map * m_map
Definition: reflowscan.h:41
v3s16 m_rel_block_pos
Definition: reflowscan.h:43
bool isLiquidHorizontallyFlowable(int x, int y, int z)
Definition: reflowscan.cpp:105
v3s16 m_block_pos
Definition: reflowscan.h:43
void scan(MapBlock *block, UniqueQueue< v3s16 > *liquid_queue)
Definition: reflowscan.cpp:33
MapBlock * lookupBlock(int x, int y, int z)
Definition: reflowscan.cpp:65
Definition: container.h:41
core::vector3d< s16 > v3s16
Definition: irr_v3d.h:28