2018-03-25 15:19:48 +02:00
|
|
|
#ifndef BLOCKDECODER_H
|
|
|
|
#define BLOCKDECODER_H
|
|
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
class BlockDecoder {
|
|
|
|
public:
|
|
|
|
BlockDecoder();
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
void decode(const ustring &data);
|
|
|
|
bool isEmpty() const;
|
|
|
|
std::string getNode(u8 x, u8 y, u8 z) const; // returns "" for air, ignore and invalid nodes
|
2020-05-08 18:50:00 +02:00
|
|
|
u8 getParam1(u8 x, u8 y, u8 z) const;
|
2018-03-25 15:19:48 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef std::unordered_map<int, std::string> NameMap;
|
|
|
|
NameMap m_nameMap;
|
|
|
|
int m_blockAirId;
|
|
|
|
int m_blockIgnoreId;
|
|
|
|
|
2020-05-06 22:31:50 +02:00
|
|
|
u8 m_version, m_contentWidth;
|
2018-03-25 15:19:48 +02:00
|
|
|
ustring m_mapData;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BLOCKDECODER_H
|