#include "include/Engine.h" namespace SE { TSmartValue& TSmartValueManager::GetSmartValue(const std::string& dictName, const std::string& valueName) { return DisctionariesMap[dictName][valueName]; } void TSmartValueManager::Serialize(boost::property_tree::ptree& propertyTree) { BOOST_FOREACH(auto& subTree, propertyTree.begin()->second) { std::string dictName = subTree.second.get(".name"); BOOST_FOREACH(auto& subSubTree, subTree.second) { if (subSubTree.first == "Record") { std::string key = subSubTree.second.get(".key"); std::string type = subSubTree.second.get(".type", ""); if (type == "int") { DisctionariesMap[dictName][key] = std::shared_ptr>(new TBindableVar(subSubTree.second.get(".value"))); } else if (type == "bool") { DisctionariesMap[dictName][key] = std::shared_ptr>(new TBindableVar(subSubTree.second.get(".value"))); } else if (type == "float") { DisctionariesMap[dictName][key] = std::shared_ptr>(new TBindableVar(subSubTree.second.get(".value"))); } else if (type == "vec2") { DisctionariesMap[dictName][key] = std::shared_ptr>(new TBindableVar(StringToVec2(subSubTree.second.get(".value")))); } else if (type == "vec3") { DisctionariesMap[dictName][key] = std::shared_ptr>(new TBindableVar(StringToVec3(subSubTree.second.get(".value")))); } else if (type == "vec4") { DisctionariesMap[dictName][key] = std::shared_ptr>(new TBindableVar(StringToVec4(subSubTree.second.get(".value")))); } else { DisctionariesMap[dictName][key] = std::shared_ptr>(new TBindableVar(subSubTree.second.get(".value"))); } } } } } } //namespace SE