X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fnameidmapping.h;h=23838c8ff221338b5c35a504597aed655b63484b;hb=593eaf3b8894137874f9fb29203ec364e292c036;hp=834ade961a627d7e3159c04156849484c81011d8;hpb=037b2591971d752e67fa7d47095b996b3f56da5a;p=dragonfireclient.git diff --git a/src/nameidmapping.h b/src/nameidmapping.h index 834ade961..23838c8ff 100644 --- a/src/nameidmapping.h +++ b/src/nameidmapping.h @@ -1,6 +1,6 @@ /* -Minetest-c55 -Copyright (C) 2011 celeron55, Perttu Ahola +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -23,15 +23,15 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include -#include "irrlichttypes.h" +#include "irrlichttypes_bloated.h" +#include "util/cpp11_container.h" class NameIdMapping { public: void serialize(std::ostream &os) const; void deSerialize(std::istream &is); - + void clear(){ m_id_to_name.clear(); m_name_to_id.clear(); @@ -55,7 +55,7 @@ class NameIdMapping m_name_to_id.erase(name); } bool getName(u16 id, std::string &result) const{ - std::map::const_iterator i; + UNORDERED_MAP::const_iterator i; i = m_id_to_name.find(id); if(i == m_id_to_name.end()) return false; @@ -63,7 +63,7 @@ class NameIdMapping return true; } bool getId(const std::string &name, u16 &result) const{ - std::map::const_iterator i; + UNORDERED_MAP::const_iterator i; i = m_name_to_id.find(name); if(i == m_name_to_id.end()) return false; @@ -74,8 +74,8 @@ class NameIdMapping return m_id_to_name.size(); } private: - std::map m_id_to_name; - std::map m_name_to_id; + UNORDERED_MAP m_id_to_name; + UNORDERED_MAP m_name_to_id; }; #endif