| 249 | auto Sorcery::MonsterStore::_parse_attacks(const std::string value) const |
| 250 | -> std::vector<Dice> { |
| 251 | |
| 252 | std::vector<Dice> attacks; |
| 253 | attacks.clear(); |
| 254 | |
| 255 | const std::regex regex(R"([,]+)"); |
| 256 | std::sregex_token_iterator it{value.begin(), value.end(), regex, -1}; |
| 257 | std::vector<std::string> split{it, {}}; |
| 258 | split.erase(std::remove_if(split.begin(), split.end(), |
| 259 | [](std::string_view s) { |
| 260 | return s.size() == 0; |
| 261 | }), |
| 262 | split.end()); |
| 263 | |
| 264 | for (const auto &each : split) { |
| 265 | |
| 266 | Dice atk{each}; |
| 267 | attacks.emplace_back(atk); |
| 268 | } |
| 269 | |
| 270 | return attacks; |
| 271 | } |
| 272 | |
| 273 | auto Sorcery::MonsterStore::_parse_breath_weapons(const std::string value) const |
| 274 | -> Enums::Monsters::Breath { |
| 275 | |
| 276 | using enum Enums::Monsters::Breath; |