Added Merchant config files and parsing of config files to merchant structure.

This commit is contained in:
2023-12-17 20:49:22 -06:00
parent f3bfa81198
commit 2b3c1ea1b4
21 changed files with 280 additions and 68 deletions
+10 -3
View File
@@ -130,12 +130,12 @@ namespace olc::utils
return m_vContent.size();
}
inline std::vector<std::string> GetValues() const
inline const std::vector<std::string>&GetValues()
{
return m_vContent;
}
inline std::unordered_map<std::string,size_t> GetKeys() const{
inline const std::unordered_map<std::string,size_t>&GetKeys(){
return m_mapObjects;
}
@@ -458,6 +458,13 @@ namespace olc::utils
return m_vecObjects[m_mapObjects[name]].second;
}
inline auto begin(){
return GetKeys().begin();
}
inline auto end(){
return GetKeys().end();
}
private:
// The "list of strings" that make up a property value
std::vector<std::string> m_vContent;
@@ -484,7 +491,7 @@ namespace olc::utils
std::string operator[](int index){return data.get().GetProperty(key).GetString(index);};
inline std::string concat(){
std::string finalStr="";
for(std::string&str:data.get().GetProperty(key).GetValues()){
for(const std::string&str:data.get().GetProperty(key).GetValues()){
if(finalStr.length()>0)finalStr+=", ";
finalStr+=str;
}