OSDN Git Service

[Refactor] #37353 Separated hook-checker.c/h from object-hook.c/h
authorHourier <hourier@users.sourceforge.jp>
Sun, 28 Jun 2020 07:14:11 +0000 (16:14 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 28 Jun 2020 07:14:11 +0000 (16:14 +0900)
38 files changed:
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/autopick/autopick-matcher.c
src/cmd-item/cmd-item.c
src/cmd/cmd-basic.c
src/combat/aura-counterattack.c
src/effect/effect-item.c
src/floor/floor-events.c
src/floor/floor-object.c
src/floor/floor-save.c
src/floor/floor.c
src/inventory/recharge-processor.c
src/io/load.c
src/mutation/mutation.c
src/object-enchant/apply-magic-accessory.c
src/object-enchant/apply-magic.c
src/object-enchant/artifact.c
src/object-enchant/object-curse.c
src/object-hook/hook-armor.c
src/object-hook/hook-checker.c [new file with mode: 0644]
src/object-hook/hook-checker.h [new file with mode: 0644]
src/object/object-flavor.c
src/object/object-hook.c
src/object/object-hook.h
src/object/object-value-calc.c
src/object/object-value.c
src/perception/identification.c
src/perception/simple-perception.c
src/player/player-effects.c
src/player/player-status.c
src/realm/realm-hex.c
src/spell-kind/spells-curse-removal.c
src/spell-kind/spells-detection.c
src/spell-kind/spells-floor.c
src/spell-kind/spells-teleport.c
src/spell/spells-object.c
src/store/store.c

index af90f02..ad15a27 100644 (file)
     <ClCompile Include="..\..\src\mind\racial-kutar.c" />\r
     <ClCompile Include="..\..\src\mind\stances-table.c" />\r
     <ClCompile Include="..\..\src\object-hook\hook-bow.c" />\r
+    <ClCompile Include="..\..\src\object-hook\hook-checker.c" />\r
     <ClCompile Include="..\..\src\object-hook\hook-perception.c" />\r
     <ClCompile Include="..\..\src\object-hook\hook-weapon.c" />\r
     <ClCompile Include="..\..\src\object-hook\hook-armor.c" />\r
     <ClInclude Include="..\..\src\mspell\mspells3.h" />\r
     <ClInclude Include="..\..\src\object-hook\hook-armor.h" />\r
     <ClInclude Include="..\..\src\object-hook\hook-bow.h" />\r
+    <ClInclude Include="..\..\src\object-hook\hook-checker.h" />\r
     <ClInclude Include="..\..\src\object-hook\hook-perception.h" />\r
     <ClInclude Include="..\..\src\object-hook\hook-weapon.h" />\r
     <ClInclude Include="..\..\src\player\bad-status-setter.h" />\r
index bb6c4bc..925aa2b 100644 (file)
     <ClCompile Include="..\..\src\object-hook\hook-armor.c">
       <Filter>object-hook</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\object-hook\hook-checker.c">
+      <Filter>object-hook</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\object-hook\hook-armor.h">
       <Filter>object-hook</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\object-hook\hook-checker.h">
+      <Filter>object-hook</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 7fca158..c9207e1 100644 (file)
@@ -434,6 +434,7 @@ hengband_SOURCES = \
        \
        object-hook/hook-armor.c object-hook/hook-armor.h \
        object-hook/hook-bow.c object-hook/hook-bow.h \
+       object-hook/hook-checker.c object-hook/hook-checker.h \
        object-hook/hook-perception.c object-hook/hook-perception.h \
        object-hook/hook-weapon.c object-hook/hook-weapon.h \
        \
index 3b1f013..1486cd4 100644 (file)
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags1.h"
 #include "perception/object-perception.h"
-#include "object/object-hook.h"
 #include "object-enchant/item-feeling.h"
 #include "object-hook/hook-armor.h"
 #include "object-hook/hook-bow.h"
+#include "object-hook/hook-checker.h"
+#include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "object/object-stack.h"
 #include "object/object-value.h"
index 329138f..bffa29f 100644 (file)
@@ -44,6 +44,7 @@
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/trc-types.h"
 #include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
 #include "object-hook/hook-weapon.h"
 #include "object/item-use-flags.h"
 #include "object/object-flavor.h"
index 9040861..d2f4f55 100644 (file)
@@ -56,6 +56,7 @@
 #include "monster/monster-info.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-types.h"
+#include "object-hook/hook-checker.h"
 #include "object-hook/hook-weapon.h"
 #include "object/item-use-flags.h"
 #include "object/object-broken.h"
index 810a715..b39e454 100644 (file)
@@ -14,7 +14,7 @@
 #include "monster/monster-status.h"
 #include "monster/monster-info.h"
 #include "object-hook/hook-armor.h"
-#include "object/object-hook.h"
+#include "object-hook/hook-checker.h"
 #include "realm/realm-hex-numbers.h"
 #include "spell/process-effect.h"
 #include "spell-realm/spells-hex.h"
index b40cffd..09a5511 100644 (file)
@@ -5,6 +5,7 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster/monster-info.h"
 #include "object-enchant/tr-types.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-broken.h"
 #include "object/object-flags.h"
 #include "object/object-flavor.h"
index 2c47a0d..fb67a9a 100644 (file)
@@ -16,6 +16,7 @@
 #include "monster/monster-status.h"
 #include "perception/object-perception.h"
 #include "object-enchant/object-ego.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "object/object-mark-types.h"
index b61dec8..29124b7 100644 (file)
@@ -17,6 +17,7 @@
 #include "object-enchant/artifact.h"
 #include "object-enchant/item-apply-magic.h"
 #include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flavor.h"
 #include "object/object-generator.h"
 #include "object/object-hook.h"
index 040af28..51f5d39 100644 (file)
@@ -49,6 +49,7 @@
 #include "monster/monster-update.h"
 #include "monster/smart-learn-types.h"
 #include "object-enchant/artifact.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-hook.h"
 #include "pet/pet-util.h"
 #include "player/player-class.h"
index a113cfe..b108065 100644 (file)
@@ -17,6 +17,7 @@
 #include "monster-floor/place-monster-types.h"
 #include "object-enchant/artifact.h"
 #include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-generator.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
index 47bce59..bd2dbee 100644 (file)
@@ -1,7 +1,7 @@
 #include "inventory/recharge-processor.h"
 #include "core/hp-mp-regenerator.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flavor.h"
-#include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "player/player-move.h"
 #include "util/quarks.h"
index b4da082..d551832 100644 (file)
@@ -55,6 +55,7 @@
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
 #include "object-enchant/trg-types.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flags.h"
 #include "object/object-generator.h"
 #include "object/object-hook.h"
index 1c2d46f..34eadb2 100644 (file)
@@ -38,7 +38,7 @@
 #include "monster/monster-info.h"
 #include "monster/smart-learn-types.h"
 #include "object-enchant/item-feeling.h"
-#include "object/object-hook.h"
+#include "object-hook/hook-checker.h"
 #include "player/avatar.h"
 #include "player/player-class.h"
 #include "player/player-damage.h"
index b2bebb9..2c3d32d 100644 (file)
@@ -12,7 +12,7 @@
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
-#include "object/object-hook.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-kind.h"
 #include "sv-definition/sv-amulet-types.h"
 #include "sv-definition/sv-ring-types.h"
index 204e45d..287f04e 100644 (file)
@@ -22,6 +22,7 @@
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
 #include "object-enchant/trg-types.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "sv-definition/sv-armor-types.h"
index 9c9ae0f..6ac4e32 100644 (file)
 #include "game-option/cheat-types.h"
 #include "grid/grid.h"
 #include "io/files-util.h"
-#include "perception/identification.h"
-#include "perception/object-perception.h"
 #include "object-enchant/object-boost.h"
 #include "object-enchant/object-curse.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/random-art-bias-types.h"
+#include "object-enchant/special-object-flags.h"
+#include "object-enchant/tr-types.h"
+#include "object-enchant/trc-types.h"
 #include "object-enchant/trg-types.h"
 #include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flags.h"
 #include "object/object-flavor.h"
 #include "object/object-generator.h"
 #include "object/object-kind-hook.h"
 #include "object/object-kind.h"
 #include "object/object-value-calc.h"
-#include "object-enchant/special-object-flags.h"
-#include "sv-definition/sv-armor-types.h"
-#include "sv-definition/sv-weapon-types.h"
-#include "system/system-variables.h"
-#include "object-enchant/tr-types.h"
-#include "object-enchant/trc-types.h"
+#include "perception/identification.h"
+#include "perception/object-perception.h"
 #include "player/avatar.h"
 #include "player/player-class.h"
 #include "player/player-personalities-types.h"
 #include "spell/spells-object.h"
+#include "sv-definition/sv-armor-types.h"
+#include "sv-definition/sv-weapon-types.h"
+#include "system/system-variables.h"
 #include "util/bit-flags-calculator.h"
 #include "util/quarks.h"
 #include "view/display-messages.h"
index 1b2f039..230cb49 100644 (file)
@@ -3,6 +3,7 @@
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
 #include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flags.h"
 #include "object/object-flavor.h"
 #include "object/object-hook.h"
index 5ee5161..395d946 100644 (file)
@@ -1,5 +1,5 @@
 #include "object-hook/hook-armor.h"
-#include "object/object-hook.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-info.h"
 #include "sv-definition/sv-armor-types.h"
 #include "system/object-type-definition.h"
diff --git a/src/object-hook/hook-checker.c b/src/object-hook/hook-checker.c
new file mode 100644 (file)
index 0000000..0982d58
--- /dev/null
@@ -0,0 +1,11 @@
+#include "object-hook/hook-checker.h"
+#include "system/object-type-definition.h"
+#include "object-enchant/special-object-flags.h"
+
+bool object_is_valid(object_type *o_ptr) { return o_ptr->k_idx != 0; }
+
+bool object_is_held_monster(object_type *o_ptr) { return o_ptr->held_m_idx != 0; }
+
+bool object_is_broken(object_type *o_ptr) { return (o_ptr->ident & IDENT_BROKEN) != 0; }
+
+bool object_is_cursed(object_type *o_ptr) { return o_ptr->curse_flags != 0; }
diff --git a/src/object-hook/hook-checker.h b/src/object-hook/hook-checker.h
new file mode 100644 (file)
index 0000000..dad8436
--- /dev/null
@@ -0,0 +1,8 @@
+#pragma once
+
+#include "system/angband.h"
+
+bool object_is_valid(object_type *o_ptr);
+bool object_is_held_monster(object_type *o_ptr);
+bool object_is_broken(object_type *o_ptr);
+bool object_is_cursed(object_type *o_ptr);
index 9a60e1a..ede00ee 100644 (file)
@@ -24,6 +24,7 @@
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trg-types.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "object/object-info.h"
index b7f7e5a..1c70dbd 100644 (file)
@@ -19,6 +19,7 @@
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trg-types.h"
 #include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flags.h"
 #include "object/object-info.h"
 #include "object/object-kind.h"
@@ -813,10 +814,6 @@ bool item_tester_okay(player_type *player_ptr, object_type *o_ptr, tval_type tva
     return TRUE;
 }
 
-bool object_is_valid(object_type *o_ptr) { return o_ptr->k_idx != 0; }
-
-bool object_is_held_monster(object_type *o_ptr) { return o_ptr->held_m_idx != 0; }
-
 /*
  * Artifacts use the "name1" field
  */
@@ -826,13 +823,3 @@ bool object_is_fixed_artifact(object_type *o_ptr) { return o_ptr->name1 != 0; }
  * Ego-Items use the "name2" field
  */
 bool object_is_ego(object_type *o_ptr) { return o_ptr->name2 != 0; }
-
-/*
- * Broken items.
- */
-bool object_is_broken(object_type *o_ptr) { return (o_ptr->ident & IDENT_BROKEN) != 0; }
-
-/*
- * Cursed items.
- */
-bool object_is_cursed(object_type *o_ptr) { return o_ptr->curse_flags != 0; }
index 4cc23dd..2917959 100644 (file)
@@ -40,9 +40,5 @@ bool object_can_refill_torch(player_type *player_ptr, object_type *o_ptr);
 bool can_player_destroy_object(player_type *player_ptr, object_type *o_ptr);
 bool object_is_quest_target(player_type *player_ptr, object_type *o_ptr);
 bool item_tester_okay(player_type *player_ptr, object_type *o_ptr, tval_type tval);
-bool object_is_valid(object_type *o_ptr);
-bool object_is_held_monster(object_type *o_ptr);
 bool object_is_fixed_artifact(object_type *o_ptr);
 bool object_is_ego(object_type *o_ptr);
-bool object_is_broken(object_type *o_ptr);
-bool object_is_cursed(object_type *o_ptr);
index 73d02be..afee34e 100644 (file)
@@ -3,6 +3,7 @@
 #include "object-enchant/object-ego.h"
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flags.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
index fc57eee..8de7925 100644 (file)
@@ -1,16 +1,17 @@
 #include "object/object-value.h"
+#include "monster-race/monster-race.h"
 #include "object-enchant/artifact.h"
-#include "object-enchant/tr-types.h"
-#include "perception/object-perception.h"
-#include "object/object-broken.h"
 #include "object-enchant/object-curse.h"
 #include "object-enchant/object-ego.h"
+#include "object-enchant/special-object-flags.h"
+#include "object-enchant/tr-types.h"
+#include "object-hook/hook-checker.h"
+#include "object/object-broken.h"
 #include "object/object-flags.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "object/object-value-calc.h"
-#include "object-enchant/special-object-flags.h"
-#include "monster-race/monster-race.h"
+#include "perception/object-perception.h"
 #include "util/bit-flags-calculator.h"
 
 /*!
index 0b39076..3bfae0f 100644 (file)
@@ -11,6 +11,7 @@
 #include "object-enchant/trc-types.h"
 #include "object/object-flags.h"
 #include "object/object-flavor.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "object/object-info.h"
index b9aea6c..06c86a1 100644 (file)
@@ -10,6 +10,7 @@
 #include "game-option/disturbance-options.h"
 #include "inventory/player-inventory.h"
 #include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flavor.h"
 #include "object/object-hook.h"
 #include "object/object-info.h"
index 57fe558..4ce9ba5 100644 (file)
@@ -41,6 +41,7 @@
 #include "object-enchant/object-ego.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/trg-types.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-generator.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
index 201f4e0..a0d8407 100644 (file)
@@ -43,6 +43,7 @@
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
 #include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flags.h"
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
index 34c7570..a94b0f3 100644 (file)
@@ -29,6 +29,7 @@
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
 #include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
 #include "object/item-use-flags.h"
 #include "object/object-flags.h"
 #include "object/object-flavor.h"
 #include "player/player-skill.h"
 #include "player/player-status.h"
 #include "realm/realm-hex-numbers.h"
-#include "spell/process-effect.h"
-#include "spell/spells-execution.h"
-#include "spell-realm/spells-hex.h"
 #include "spell-kind/spells-launcher.h"
 #include "spell-kind/spells-neighbor.h"
 #include "spell-kind/spells-sight.h"
-#include "spell/spells-status.h"
 #include "spell-kind/spells-teleport.h"
+#include "spell-realm/spells-hex.h"
+#include "spell/process-effect.h"
 #include "spell/spell-types.h"
+#include "spell/spells-execution.h"
+#include "spell/spells-status.h"
 #include "spell/spells3.h"
 #include "spell/technic-info-table.h"
 #include "term/screen-processor.h"
index efcffae..bfd3581 100644 (file)
@@ -2,7 +2,7 @@
 #include "object-enchant/item-feeling.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/trc-types.h"
-#include "object/object-hook.h"
+#include "object-hook/hook-checker.h"
 #include "system/object-type-definition.h"
 #include "view/display-messages.h"
 
index 41c62cb..0cbba4e 100644 (file)
@@ -12,6 +12,7 @@
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
 #include "realm/realm-song-numbers.h"
index b3fbf05..e6cc7dd 100644 (file)
@@ -30,6 +30,7 @@
 #include "monster/smart-learn-types.h"
 #include "object-enchant/artifact.h"
 #include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flavor.h"
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
index 23777f8..bc428d2 100644 (file)
@@ -34,8 +34,8 @@
 #include "monster/monster-update.h"
 #include "monster/smart-learn-types.h"
 #include "object-enchant/tr-types.h"
+#include "object-hook/hook-checker.h"
 #include "object/object-flags.h"
-#include "object/object-hook.h"
 #include "player/avatar.h"
 #include "player/player-move.h"
 #include "spell-kind/spells-launcher.h"
index c64f875..ac97c9b 100644 (file)
@@ -31,6 +31,7 @@
 #include "object-enchant/trg-types.h"
 #include "object-hook/hook-armor.h"
 #include "object-hook/hook-bow.h"
+#include "object-hook/hook-checker.h"
 #include "object/item-use-flags.h"
 #include "object/object-flags.h"
 #include "object/object-flavor.h"
index e47ecb2..a5d1159 100644 (file)
@@ -57,6 +57,7 @@
 #include "mind/mind.h"
 #include "object-enchant/item-feeling.h"
 #include "object-enchant/special-object-flags.h"
+#include "object-hook/hook-checker.h"
 #include "object/item-use-flags.h"
 #include "object/object-flavor.h"
 #include "object/object-generator.h"