-#include "flavor/flavor-util.h"
+#include "flavor/flavor-util.h"
#include "flavor/flag-inscriptions-table.h"
#include "object-enchant/tr-flags.h"
#include "object-enchant/tr-types.h"
-#include "object/object-flags.h"
#include "object/tval-types.h"
#include "sv-definition/sv-food-types.h"
#include "system/artifact-type-definition.h"
#include "system/item-entity.h"
-#include "util/quarks.h"
#include "util/string-processor.h"
#include <sstream>
std::stringstream ss;
for (const auto &fi : fi_vec) {
- if (flags.has(fi.flag) && (!fi.except_flag.has_value() || flags.has_not(fi.except_flag.value()))) {
+ if (flags.has(fi.flag) && (!fi.except_flag || flags.has_not(*fi.except_flag))) {
const auto flag_str = _(is_kanji ? fi.japanese : fi.english, fi.english);
ss << flag_str;
}
static bool has_flag_of(const std::vector<flag_insc_table> &fi_vec, const TrFlags &flags)
{
for (const auto &fi : fi_vec) {
- if (flags.has(fi.flag) && (!fi.except_flag.has_value() || flags.has_not(fi.except_flag.value()))) {
+ if (flags.has(fi.flag) && (!fi.except_flag || flags.has_not(*fi.except_flag))) {
return true;
}
}
*/
std::string get_ability_abbreviation(const ItemEntity &item, bool is_kanji, bool all)
{
- auto flags = object_flags(&item);
+ auto flags = item.get_flags();
if (!all) {
const auto &baseitem = item.get_baseitem();
flags.reset(baseitem.flags);
std::stringstream ss;
if (!item.is_fully_known()) {
- for (std::string_view sv = item.inscription.value(); !sv.empty(); sv.remove_prefix(1)) {
+ for (std::string_view sv = *item.inscription; !sv.empty(); sv.remove_prefix(1)) {
if (sv.front() == '#') {
break;
}
return ss.str();
}
- for (std::string_view sv = item.inscription.value(); !sv.empty(); sv.remove_prefix(1)) {
+ for (std::string_view sv = *item.inscription; !sv.empty(); sv.remove_prefix(1)) {
switch (sv.front()) {
case '#':
return ss.str();
break;
case ItemKindType::FOOD:
- if (item.bi_key.sval().value() == SV_FOOD_JERKY) {
+ if (item.bi_key.sval() == SV_FOOD_JERKY) {
ss << "切れ";
break;
}