Problem.cpp 907 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Problem.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "Problem.h"
  12. #include "../texts/MetaString.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. namespace spells
  15. {
  16. namespace detail
  17. {
  18. void ProblemImpl::add(MetaString && description, Severity severity)
  19. {
  20. data.emplace_back(description, severity);
  21. }
  22. void ProblemImpl::getAll(std::vector<std::string> & target) const
  23. {
  24. for(const auto & p : data)
  25. target.push_back(p.first.toString());
  26. }
  27. //void ProblemImpl::getMostSevere(std::vector<std::string> & target) const
  28. //{
  29. // //TODO:
  30. //}
  31. //
  32. //std::string ProblemImpl::getMostSevere() const
  33. //{
  34. // std::vector<std::string> temp;
  35. // getMostSevere(temp);
  36. // return temp.empty() ? "" : temp.front();
  37. //}
  38. }
  39. }
  40. VCMI_LIB_NAMESPACE_END