From: Hourier Date: Thu, 28 May 2020 10:43:09 +0000 (+0900) Subject: [Refactor] #40399 Separated item-use-flags.h from object.h X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=fa78ea6c0cad2d4e7049321db0bda1135a0b79a8;p=hengband%2Fhengband.git [Refactor] #40399 Separated item-use-flags.h from object.h --- diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index 7c0a89c2b..85d7237a4 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -501,6 +501,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 7877af0e0..53d966db9 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -2161,6 +2161,9 @@ object + + object + diff --git a/src/Makefile.am b/src/Makefile.am index ccd4833f1..30f0157b5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -207,6 +207,7 @@ hengband_SOURCES = \ object/tr-types.h object/trc-types.h object/tval-type.h \ object/old-ego-extra-values.h object/special-object-flags.h \ object/object-mark-types.h object/object-util.h \ + object/item-use-flags.h \ \ inventory/simple-appraiser.c inventory/simple-appraiser.h \ inventory/inventory-curse.c inventory/inventory-curse.h \ diff --git a/src/autopick/autopick-entry.c b/src/autopick/autopick-entry.c index e472e111e..56ef92739 100644 --- a/src/autopick/autopick-entry.c +++ b/src/autopick/autopick-entry.c @@ -5,6 +5,7 @@ #include "autopick/autopick-keys-table.h" #include "autopick/autopick-methods-table.h" #include "autopick/autopick-key-flag-process.h" +#include "object/item-use-flags.h" #include "object/object-ego.h" #include "object/object-kind.h" #include "object/object-flavor.h" diff --git a/src/autopick/autopick-finder.c b/src/autopick/autopick-finder.c index 1a0f7ccff..d6600f908 100644 --- a/src/autopick/autopick-finder.c +++ b/src/autopick/autopick-finder.c @@ -10,6 +10,7 @@ #include "autopick/autopick-dirty-flags.h" #include "autopick/autopick-entry.h" #include "autopick/autopick-matcher.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "term/gameterm.h" #include "inventory/player-inventory.h" diff --git a/src/cmd/cmd-activate.c b/src/cmd/cmd-activate.c index 9a81436b2..c409d656a 100644 --- a/src/cmd/cmd-activate.c +++ b/src/cmd/cmd-activate.c @@ -15,6 +15,7 @@ #include "object/object-hook.h" #include "core/sort.h" #include "object/artifact.h" +#include "object/item-use-flags.h" #include "player/avatar.h" #include "spell/spells-summon.h" #include "spell/spells-status.h" diff --git a/src/cmd/cmd-attack.c b/src/cmd/cmd-attack.c index 7c5dfddd5..a5a545935 100644 --- a/src/cmd/cmd-attack.c +++ b/src/cmd/cmd-attack.c @@ -13,6 +13,7 @@ #include "main/sound-definitions-table.h" #include "monster/monster-status.h" #include "object/artifact.h" +#include "object/item-use-flags.h" #include "player/avatar.h" #include "player/player-damage.h" #include "player/player-effects.h" diff --git a/src/cmd/cmd-basic.c b/src/cmd/cmd-basic.c index 3818973d8..c6f21e645 100644 --- a/src/cmd/cmd-basic.c +++ b/src/cmd/cmd-basic.c @@ -39,6 +39,7 @@ #include "player/player-effects.h" #include "player/player-personalities-table.h" #include "inventory/player-inventory.h" +#include "object/item-use-flags.h" #include "object/object-kind.h" #include "object/object-broken.h" #include "object/object-flavor.h" diff --git a/src/cmd/cmd-eat.c b/src/cmd/cmd-eat.c index 651f7213a..f1ab34a96 100644 --- a/src/cmd/cmd-eat.c +++ b/src/cmd/cmd-eat.c @@ -23,6 +23,7 @@ #include "player/player-class.h" #include "inventory/player-inventory.h" #include "floor/floor.h" +#include "object/item-use-flags.h" #include "object/object-kind.h" #include "object/special-object-flags.h" #include "view/display-main-window.h" diff --git a/src/cmd/cmd-hissatsu.c b/src/cmd/cmd-hissatsu.c index 50a8ae08c..67eff6dc6 100644 --- a/src/cmd/cmd-hissatsu.c +++ b/src/cmd/cmd-hissatsu.c @@ -20,6 +20,7 @@ #include "player/player-effects.h" #include "inventory/player-inventory.h" #include "spell/technic-info-table.h" +#include "object/item-use-flags.h" #include "cmd-basic.h" #include "cmd-spell.h" diff --git a/src/cmd/cmd-item.c b/src/cmd/cmd-item.c index a50be2927..4506d0112 100644 --- a/src/cmd/cmd-item.c +++ b/src/cmd/cmd-item.c @@ -27,6 +27,7 @@ #include "cmd-pet.h" #include "cmd-basic.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "object/object-hook.h" #include "object/object-ego.h" diff --git a/src/cmd/cmd-quaff.c b/src/cmd/cmd-quaff.c index dff46f3a6..4afc0f7c2 100644 --- a/src/cmd/cmd-quaff.c +++ b/src/cmd/cmd-quaff.c @@ -23,6 +23,7 @@ #include "inventory/player-inventory.h" #include "realm/realm-hex.h" #include "spell/spells-floor.h" +#include "object/item-use-flags.h" #include "object/object-broken.h" #include "cmd-basic.h" #include "floor/floor.h" diff --git a/src/cmd/cmd-read.c b/src/cmd/cmd-read.c index 8094e0489..2cdc50071 100644 --- a/src/cmd/cmd-read.c +++ b/src/cmd/cmd-read.c @@ -10,6 +10,7 @@ #include "util/util.h" #include "main/sound-definitions-table.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "object/object-hook.h" #include "object/artifact.h" diff --git a/src/cmd/cmd-smith.c b/src/cmd/cmd-smith.c index ec58491de..3d3c75eae 100644 --- a/src/cmd/cmd-smith.c +++ b/src/cmd/cmd-smith.c @@ -2,6 +2,7 @@ #include "util/util.h" #include "term/gameterm.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "object/object-hook.h" #include "object/object-ego.h" diff --git a/src/cmd/cmd-spell.c b/src/cmd/cmd-spell.c index 21f3eff7e..ac18b113b 100644 --- a/src/cmd/cmd-spell.c +++ b/src/cmd/cmd-spell.c @@ -36,6 +36,7 @@ #include "locale/japanese.h" #include "spell/spells-util.h" #include "spell/spells-execution.h" +#include "object/item-use-flags.h" /*! * 魔法領域フラグ管理テーブル / diff --git a/src/cmd/cmd-usestaff.c b/src/cmd/cmd-usestaff.c index 7946ca00f..a2441902f 100644 --- a/src/cmd/cmd-usestaff.c +++ b/src/cmd/cmd-usestaff.c @@ -15,6 +15,7 @@ #include "object/object-hook.h" #include "cmd-basic.h" #include "floor/floor.h" +#include "object/item-use-flags.h" #include "object/object-kind.h" #include "object/special-object-flags.h" #include "view/display-main-window.h" diff --git a/src/cmd/cmd-zaprod.c b/src/cmd/cmd-zaprod.c index a4fde8141..a53c99838 100644 --- a/src/cmd/cmd-zaprod.c +++ b/src/cmd/cmd-zaprod.c @@ -7,6 +7,7 @@ #include "player/player-effects.h" #include "player/player-class.h" #include "inventory/player-inventory.h" +#include "object/item-use-flags.h" #include "object/object-kind.h" #include "object/object-hook.h" #include "object/special-object-flags.h" diff --git a/src/cmd/cmd-zapwand.c b/src/cmd/cmd-zapwand.c index db753292a..2db1fa675 100644 --- a/src/cmd/cmd-zapwand.c +++ b/src/cmd/cmd-zapwand.c @@ -9,6 +9,7 @@ #include "player/player-effects.h" #include "player/player-class.h" #include "inventory/player-inventory.h" +#include "object/item-use-flags.h" #include "object/object-kind.h" #include "object/object-hook.h" #include "object/special-object-flags.h" diff --git a/src/inventory/player-inventory.c b/src/inventory/player-inventory.c index bfdd85147..a4ac66995 100644 --- a/src/inventory/player-inventory.c +++ b/src/inventory/player-inventory.c @@ -4,6 +4,7 @@ #include "inventory/player-inventory.h" #include "term/gameterm.h" +#include "object/item-use-flags.h" #include "object/object1.h" #include "object/object-kind.h" #include "object/object-flavor.h" diff --git a/src/market/building-craft-fix.c b/src/market/building-craft-fix.c index 971bd1140..065802b4d 100644 --- a/src/market/building-craft-fix.c +++ b/src/market/building-craft-fix.c @@ -11,6 +11,7 @@ #include "player/player-effects.h" #include "core/stuff-handler.h" #include "object/tr-types.h" +#include "object/item-use-flags.h" /*! * @brief 修復材料のオブジェクトから修復対象に特性を移植する。 diff --git a/src/market/building-craft-weapon.c b/src/market/building-craft-weapon.c index f776fe51f..45cde9238 100644 --- a/src/market/building-craft-weapon.c +++ b/src/market/building-craft-weapon.c @@ -12,6 +12,7 @@ #include "market/building-util.h" #include "core/stuff-handler.h" #include "object/tr-types.h" +#include "object/item-use-flags.h" /*! * @brief 攻撃時スレイによるダメージ期待値修正計算 / critical happens at i / 10000 diff --git a/src/market/building-enchanter.c b/src/market/building-enchanter.c index b392a0ab1..7f14a45ee 100644 --- a/src/market/building-enchanter.c +++ b/src/market/building-enchanter.c @@ -1,5 +1,6 @@ #include "system/angband.h" #include "market/building-enchanter.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "spell/spells-object.h" #include "market/building-util.h" diff --git a/src/market/building-recharger.c b/src/market/building-recharger.c index 172036532..5db26b101 100644 --- a/src/market/building-recharger.c +++ b/src/market/building-recharger.c @@ -1,5 +1,6 @@ #include "system/angband.h" #include "market/building-recharger.h" +#include "object/item-use-flags.h" #include "object/object-hook.h" #include "object/object-kind.h" #include "object/object-flavor.h" diff --git a/src/object/item-use-flags.h b/src/object/item-use-flags.h new file mode 100644 index 000000000..ed2e7f39c --- /dev/null +++ b/src/object/item-use-flags.h @@ -0,0 +1,13 @@ +#pragma once + +/* + * get_item()関数でアイテムの選択を行うフラグ / Bit flags for the "get_item" function + */ +typedef enum item_use_flag { + USE_EQUIP = 0x01, /*!< アイテム表示/選択範囲: 装備品からの選択を許可する / Allow equip items */ + USE_INVEN = 0x02, /*!< アイテム表示/選択範囲: 所持品からの選択を許可する / Allow inven items */ + USE_FLOOR = 0x04, /*!< アイテム表示/選択範囲: 床下のアイテムからの選択を許可する / Allow floor items */ + USE_FORCE = 0x08, /*!< 特殊: wキーで錬気術への切り替えを許可する */ + IGNORE_BOTHHAND_SLOT = 0x10, /*!< アイテム表示/選択範囲: 両手持ちスロットを選択に含めない */ + USE_FULL = 0x20, /*!< アイテム表示/選択範囲: 空欄まですべて表示する*/ +} item_use_flag; diff --git a/src/object/object1.h b/src/object/object1.h index 811daee26..d3652a45b 100644 --- a/src/object/object1.h +++ b/src/object/object1.h @@ -50,16 +50,6 @@ extern s16b wield_slot(player_type *owner_ptr, object_type *o_ptr); extern bool check_book_realm(player_type *owner_ptr, const tval_type book_tval, const OBJECT_SUBTYPE_VALUE book_sval); -/* - * get_item()関数でアイテムの選択を行うフラグ / Bit flags for the "get_item" function - */ -#define USE_EQUIP 0x01 /*!< アイテム表示/選択範囲: 装備品からの選択を許可する / Allow equip items */ -#define USE_INVEN 0x02 /*!< アイテム表示/選択範囲: 所持品からの選択を許可する / Allow inven items */ -#define USE_FLOOR 0x04 /*!< アイテム表示/選択範囲: 床下のアイテムからの選択を許可する / Allow floor items */ -#define USE_FORCE 0x08 /*!< 特殊: wキーで錬気術への切り替えを許可する */ -#define IGNORE_BOTHHAND_SLOT 0x10 /*!< アイテム表示/選択範囲: 両手持ちスロットを選択に含めない */ -#define USE_FULL 0x20 /*!< アイテム表示/選択範囲: 空欄まですべて表示する*/ - #define REF_ITEM(P_PTR, FLOOR_PTR, ID) ((ID >= 0 ? &(P_PTR)->inventory_list[ID] : &(FLOOR_PTR)->o_list[0 - item])) extern int bow_tval_ammo(object_type *o_ptr); diff --git a/src/player/process-death.c b/src/player/process-death.c index cdb8f63de..a4555d658 100644 --- a/src/player/process-death.c +++ b/src/player/process-death.c @@ -10,6 +10,7 @@ #include "world/world.h" #include "floor/floor-town.h" #include "inventory/player-inventory.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "store/store-util.h" #include "store/store.h" diff --git a/src/realm/realm-hex.c b/src/realm/realm-hex.c index c036ec475..adb1520ad 100644 --- a/src/realm/realm-hex.c +++ b/src/realm/realm-hex.c @@ -45,6 +45,7 @@ #include "spell/spells3.h" #include "object/tr-types.h" #include "object/trc-types.h" +#include "object/item-use-flags.h" #define MAX_KEEP 4 /*!<呪術の最大詠唱数 */ diff --git a/src/spell/spells-object.c b/src/spell/spells-object.c index e13e83c07..278a8239e 100644 --- a/src/spell/spells-object.c +++ b/src/spell/spells-object.c @@ -8,6 +8,7 @@ #include "grid/grid.h" #include "spell/spells3.h" #include "spell/spells-object.h" +#include "object/item-use-flags.h" #include "object/object-boost.h" #include "object/object-hook.h" #include "object/object-flavor.h" diff --git a/src/spell/spells-summon.c b/src/spell/spells-summon.c index b37ec8eed..1d78c023f 100644 --- a/src/spell/spells-summon.c +++ b/src/spell/spells-summon.c @@ -7,6 +7,7 @@ #include "floor/floor.h" #include "effect/spells-effect-util.h" #include "spell/spells2.h" +#include "object/item-use-flags.h" #include "object/object-hook.h" /*! diff --git a/src/spell/spells2.c b/src/spell/spells2.c index 491fb630a..4d040f8a2 100644 --- a/src/spell/spells2.c +++ b/src/spell/spells2.c @@ -38,6 +38,7 @@ #include "spell/spells-diceroll.h" #include "realm/realm-hex.h" #include "autopick/autopick.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "object/object-hook.h" #include "object/object-mark-types.h" diff --git a/src/spell/spells3.c b/src/spell/spells3.c index a4847619e..4861f2a23 100644 --- a/src/spell/spells3.c +++ b/src/spell/spells3.c @@ -25,6 +25,7 @@ #include "dungeon/dungeon.h" #include "effect/effect-characteristics.h" #include "floor/floor-town.h" +#include "object/item-use-flags.h" #include "object/object-boost.h" #include "object/object-flavor.h" #include "object/object-hook.h" diff --git a/src/store/store.c b/src/store/store.c index fb6c54bb7..3776ecf36 100644 --- a/src/store/store.c +++ b/src/store/store.c @@ -46,6 +46,7 @@ #include "player/player-status.h" #include "player/player-class.h" #include "inventory/player-inventory.h" +#include "object/item-use-flags.h" #include "object/object-flavor.h" #include "object/object-hook.h" #include "floor/floor-events.h" diff --git a/src/wizard/wizard-special-process.c b/src/wizard/wizard-special-process.c index 1c6eea5b5..f3169669b 100644 --- a/src/wizard/wizard-special-process.c +++ b/src/wizard/wizard-special-process.c @@ -62,6 +62,7 @@ #include "spell/spells3.h" #include "spell/spells-detection.h" #include "player/player-races-table.h" +#include "object/item-use-flags.h" #include "object/trc-types.h" #define NUM_O_SET 8