2014-09-13 19:32:00 -04:00
|
|
|
#pragma once
|
2014-09-18 04:24:52 -04:00
|
|
|
|
2014-09-13 19:32:00 -04:00
|
|
|
#include <QObject>
|
|
|
|
#include <QRunnable>
|
2014-09-18 04:24:52 -04:00
|
|
|
#include <memory>
|
2014-09-13 19:32:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fwd:
|
|
|
|
class Chunk;
|
|
|
|
typedef std::shared_ptr<Chunk> ChunkPtr;
|
|
|
|
|
|
|
|
class ChunkSource;
|
|
|
|
typedef std::shared_ptr<ChunkSource> ChunkSourcePtr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ChunkLoader :
|
|
|
|
public QObject,
|
|
|
|
public QRunnable
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
ChunkLoader(int a_ChunkX, int a_ChunkZ, ChunkPtr a_Chunk, ChunkSourcePtr a_ChunkSource);
|
|
|
|
virtual ~ChunkLoader() {}
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void loaded(int a_ChunkX, int a_ChunkZ);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void run() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
int m_ChunkX, m_ChunkZ;
|
|
|
|
ChunkPtr m_Chunk;
|
|
|
|
ChunkSourcePtr m_ChunkSource;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|