summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/RegionLoader.h
blob: 5a993f5ca44705b1b1bb70e452f6cedb8203276e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once

#include <QObject>
#include <QRunnable>
#include <memory>




// fwd:
class Region;
typedef std::shared_ptr<Region> RegionPtr;

class ChunkSource;
typedef std::shared_ptr<ChunkSource> ChunkSourcePtr;





class RegionLoader :
	public QObject,
	public QRunnable
{
	Q_OBJECT

public:
	RegionLoader(int a_RegionX, int a_RegionZ, RegionPtr a_Region, ChunkSourcePtr a_ChunkSource);
	virtual ~RegionLoader() {}

signals:
	void loaded(int a_RegionX, int a_RegionZ);

protected:
	virtual void run() override;

private:
	/** Coords of the region to be loaded. */
	int m_RegionX, m_RegionZ;

	/** The region to be loaded. */
	RegionPtr m_Region;

	/** The chunk source to be used for individual chunks within the region. */
	ChunkSourcePtr m_ChunkSource;
};