* Get a badge by label if it exists. * @param label Label of badge. * @returns Badge with specified label, or nullptr if it does not exist. */
| 122 | * @returns Badge with specified label, or nullptr if it does not exist. |
| 123 | */ |
| 124 | Badge *GetBadgeByLabel(std::string_view label) |
| 125 | { |
| 126 | auto it = std::ranges::find(_badges.specs, label, &Badge::label); |
| 127 | if (it == std::end(_badges.specs)) return nullptr; |
| 128 | |
| 129 | return &*it; |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * Get the badge for a badge class index. |
no test coverage detected