orotool/src/oro/shops.cpp

21 lines
409 B
C++
Raw Normal View History

2020-06-23 10:19:02 +02:00
#include "shops.hpp"
#include <stdexcept>
namespace oro {
ShopTypeWrapper::ShopTypeWrapper (const std::string& str) {
*this = str;
}
ShopTypeWrapper& ShopTypeWrapper::operator= (const std::string& str) {
if ("V" == str)
value = ShopType::Vending;
else if ("B" == str)
value = ShopType::Buying;
else
throw std::runtime_error("Unknown shop type '" + str + "'");
return *this;
}
} //namespace oro