Files
mod-playerbots/src/strategy/values/OutfitListValue.cpp
2024-08-04 10:23:36 +08:00

39 lines
843 B
C++

/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it
* and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#include "OutfitListValue.h"
#include "Playerbots.h"
std::string const OutfitListValue::Save()
{
std::ostringstream out;
bool first = true;
for (Outfit::iterator i = value.begin(); i != value.end(); ++i)
{
if (!first)
out << "^";
else
first = false;
out << *i;
}
return out.str();
}
bool OutfitListValue::Load(std::string const text)
{
value.clear();
std::vector<std::string> ss = split(text, '^');
for (std::vector<std::string>::iterator i = ss.begin(); i != ss.end(); ++i)
{
value.push_back(*i);
}
return true;
}