mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Make templates localizable (Closes #100)
This commit is contained in:
@@ -145,9 +145,9 @@ private:
|
||||
|
||||
// ----------------------------------------------------------------------------- : Collections : maps
|
||||
|
||||
template <typename V>
|
||||
ScriptValueP get_member(const map<String,V>& m, const String& name) {
|
||||
typename map<String,V>::const_iterator it = m.find(name);
|
||||
template <typename Container>
|
||||
ScriptValueP get_member(const Container& m, const String& name) {
|
||||
auto it = m.find(name);
|
||||
if (it != m.end()) {
|
||||
return to_script(it->second);
|
||||
} else {
|
||||
@@ -403,6 +403,10 @@ inline ScriptValueP to_script(const map<K,V>* v) {
|
||||
return make_intrusive<ScriptMap<map<K,V>>>(v);
|
||||
}
|
||||
template <typename K, typename V>
|
||||
inline ScriptValueP to_script(const unordered_map<K,V>* v) {
|
||||
return make_intrusive<ScriptMap<unordered_map<K,V>>>(v);
|
||||
}
|
||||
template <typename K, typename V>
|
||||
inline ScriptValueP to_script(const IndexMap<K,V>* v) {
|
||||
return make_intrusive<ScriptMap<IndexMap<K,V>>>(v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user