OSDN Git Service

[Refactor] #3756 冗長化していたBaseitemKey::is_equipment() を簡略化した
authorHourier <66951241+Hourier@users.noreply.github.com>
Sat, 2 Dec 2023 01:46:17 +0000 (10:46 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Sat, 2 Dec 2023 01:46:17 +0000 (10:46 +0900)
src/system/baseitem-info.cpp

index b2b6bec..a0d76e5 100644 (file)
@@ -272,32 +272,7 @@ bool BaseitemKey::is_weapon() const
 
 bool BaseitemKey::is_equipement() const
 {
-    switch (this->type_value) {
-    case ItemKindType::SHOT:
-    case ItemKindType::ARROW:
-    case ItemKindType::BOLT:
-    case ItemKindType::BOW:
-    case ItemKindType::DIGGING:
-    case ItemKindType::HAFTED:
-    case ItemKindType::POLEARM:
-    case ItemKindType::SWORD:
-    case ItemKindType::BOOTS:
-    case ItemKindType::GLOVES:
-    case ItemKindType::HELM:
-    case ItemKindType::CROWN:
-    case ItemKindType::SHIELD:
-    case ItemKindType::CLOAK:
-    case ItemKindType::SOFT_ARMOR:
-    case ItemKindType::HARD_ARMOR:
-    case ItemKindType::DRAG_ARMOR:
-    case ItemKindType::LITE:
-    case ItemKindType::AMULET:
-    case ItemKindType::RING:
-    case ItemKindType::CARD:
-        return true;
-    default:
-        return false;
-    }
+    return this->is_wearable() || this->is_ammo();
 }
 
 bool BaseitemKey::is_melee_ammo() const