1
0
mirror of https://github.com/luanti-org/minetestmapper.git synced 2025-10-05 21:35:22 +02:00

C++11 code modernization

This commit is contained in:
sfan5
2020-03-26 23:07:27 +01:00
parent 1d678ffa82
commit 9096f70188
8 changed files with 46 additions and 66 deletions

View File

@@ -1,11 +1,7 @@
#ifndef BLOCKDECODER_H
#define BLOCKDECODER_H
#if __cplusplus >= 201103L
#include <unordered_map>
#else
#include <map>
#endif
#include "types.h"
@@ -19,11 +15,7 @@ public:
std::string getNode(u8 x, u8 y, u8 z) const; // returns "" for air, ignore and invalid nodes
private:
#if __cplusplus >= 201103L
typedef std::unordered_map<int, std::string> NameMap;
#else
typedef std::map<int, std::string> NameMap;
#endif
NameMap m_nameMap;
int m_blockAirId;
int m_blockIgnoreId;