mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-22 07:23:46 +01:00
29 lines
553 B
C++
29 lines
553 B
C++
#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
|
|
u8 getParam1(u8 x, u8 y, u8 z) const;
|
|
|
|
private:
|
|
typedef std::unordered_map<int, std::string> NameMap;
|
|
NameMap m_nameMap;
|
|
int m_blockAirId;
|
|
int m_blockIgnoreId;
|
|
|
|
u8 m_version, m_contentWidth;
|
|
ustring m_mapData;
|
|
};
|
|
|
|
#endif // BLOCKDECODER_H
|