From: Hourier <66951241+Hourier@users.noreply.github.com> Date: Sat, 2 Dec 2023 04:14:09 +0000 (+0900) Subject: [Refactor] #3756 BaseitemKey::refuse_enchant_weapon() を定義した X-Git-Tag: 3.0.1.3-Beta~5^2~8 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ee57b7fa5429e82a02344b0b62fc40fdfe923264;p=hengbandforosx%2Fhengbandosx.git [Refactor] #3756 BaseitemKey::refuse_enchant_weapon() を定義した --- diff --git a/src/system/baseitem-info.cpp b/src/system/baseitem-info.cpp index a0d76e5ee..96a84957b 100644 --- a/src/system/baseitem-info.cpp +++ b/src/system/baseitem-info.cpp @@ -507,6 +507,11 @@ bool BaseitemKey::is_cross_bow() const } } +bool BaseitemKey::refuse_enchant_weapon() const +{ + return *this == BaseitemKey(ItemKindType::SWORD, SV_POISON_NEEDLE); +} + bool BaseitemKey::is_mushrooms() const { if (!this->subtype_value) { diff --git a/src/system/baseitem-info.h b/src/system/baseitem-info.h index 27c4b8d9c..e139239b8 100644 --- a/src/system/baseitem-info.h +++ b/src/system/baseitem-info.h @@ -70,6 +70,7 @@ public: bool is_junk() const; bool is_armour() const; bool is_cross_bow() const; + bool refuse_enchant_weapon() const; private: ItemKindType type_value; diff --git a/src/system/item-entity.cpp b/src/system/item-entity.cpp index 758dcba0b..555013c6d 100644 --- a/src/system/item-entity.cpp +++ b/src/system/item-entity.cpp @@ -214,7 +214,7 @@ bool ItemEntity::is_wieldable_in_etheir_hand() const */ bool ItemEntity::refuse_enchant_weapon() const { - return this->bi_key == BaseitemKey(ItemKindType::SWORD, SV_POISON_NEEDLE); + return this->bi_key.refuse_enchant_weapon(); } /*!