minetestmapper/include/BlockDecoder.h

26 lines
468 B
C
Raw Normal View History

#pragma once
2018-03-25 15:19:48 +02:00
#include <unordered_map>
#include "types.h"
class BlockDecoder {
public:
BlockDecoder();
void reset();
void decode(const ustring &data);
bool isEmpty() const;
// returns "" for air, ignore and invalid nodes
const std::string &getNode(u8 x, u8 y, u8 z) const;
2018-03-25 15:19:48 +02:00
private:
typedef std::unordered_map<uint16_t, std::string> NameMap;
2018-03-25 15:19:48 +02:00
NameMap m_nameMap;
int m_blockAirId;
int m_blockIgnoreId;
u8 m_version, m_contentWidth;
2018-03-25 15:19:48 +02:00
ustring m_mapData;
};