• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionfff15ebf01541ddc16eae5457f09acee9787940e (tree)
Time2019-05-01 14:11:01
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 autopick.h を作成して関連構造体と変数を移動.

Change Summary

Incremental Difference

--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj
@@ -192,6 +192,7 @@
192192 <ClCompile Include="..\..\src\cmd-zaprod.c" />
193193 <ClCompile Include="..\..\src\cmd-zapwand.c" />
194194 <ClInclude Include="..\..\src\artifact.h" />
195+ <ClInclude Include="..\..\src\autopick.h" />
195196 <ClInclude Include="..\..\src\avatar.h" />
196197 <ClInclude Include="..\..\src\birth.h" />
197198 <ClInclude Include="..\..\src\bldg.h" />
--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
@@ -623,6 +623,9 @@
623623 <ClInclude Include="..\..\src\monsterrace.h">
624624 <Filter>monster</Filter>
625625 </ClInclude>
626+ <ClInclude Include="..\..\src\autopick.h">
627+ <Filter>object</Filter>
628+ </ClInclude>
626629 </ItemGroup>
627630 <ItemGroup>
628631 <ResourceCompile Include="..\..\src\angband.rc" />
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -7,7 +7,7 @@ bin_PROGRAMS = hengband
77 hengband_SOURCES = \
88 artifact.c artifact.h \
99 \
10- angband.h autopick.c \
10+ angband.h autopick.c autopick.h\
1111 \
1212 avatar.h avatar.c birth.c birth.h \
1313 \
--- a/src/autopick.c
+++ b/src/autopick.c
@@ -13,6 +13,7 @@
1313
1414 #include "angband.h"
1515 #include "util.h"
16+#include "autopick.h"
1617
1718 #include "mind.h"
1819
@@ -216,6 +217,13 @@ static GAME_TEXT KEY_BOOTS[] = "boots";
216217
217218
218219 /*
220+ * 自動拾い/破壊設定のリストに関する変数 / List for auto-picker/destroyer entries
221+ */
222+int max_autopick = 0; /*!< 現在登録している自動拾い/破壊設定の数 */
223+int max_max_autopick = 0; /*!< 自動拾い/破壊設定の限界数 */
224+autopick_type *autopick_list = NULL; /*!< 自動拾い/破壊設定構造体のポインタ配列 */
225+
226+/*
219227 * A function to create new entry
220228 */
221229 static bool autopick_new_entry(autopick_type *entry, concptr str, bool allow_default)
--- /dev/null
+++ b/src/autopick.h
@@ -0,0 +1,32 @@
1+#pragma once
2+
3+/*!
4+ * @struct autopick_type
5+ * @brief 自動拾い/破壊設定データの構造体 / A structure type for entry of auto-picker/destroyer
6+ */
7+typedef struct {
8+ concptr name; /*!< 自動拾い/破壊定義の名称一致基準 / Items which have 'name' as part of its name match */
9+ concptr insc; /*!< 対象となったアイテムに自動で刻む内容 / Items will be auto-inscribed as 'insc' */
10+ BIT_FLAGS flag[2]; /*!< キーワードに関する汎用的な条件フラグ / Misc. keyword to be matched */
11+ byte action; /*!< 対象のアイテムを拾う/破壊/放置するかの指定フラグ / Auto-pickup or Destroy or Leave items */
12+ byte dice; /*!< 武器のダイス値基準値 / Weapons which have more than 'dice' dice match */
13+ byte bonus; /*!< アイテムのボーナス基準値 / Items which have more than 'bonus' magical bonus match */
14+} autopick_type;
15+
16+/*
17+ * List for auto-picker/destroyer entries
18+ */
19+extern int max_autopick;
20+extern int max_max_autopick;
21+extern autopick_type *autopick_list;
22+
23+/* autopick.c */
24+extern void autopick_load_pref(bool disp_mes);
25+extern errr process_autopick_file_command(char *buf);
26+extern concptr autopick_line_from_entry(autopick_type *entry);
27+extern int is_autopick(object_type *o_ptr);
28+extern void autopick_alter_item(INVENTORY_IDX item, bool destroy);
29+extern void autopick_delayed_alter(void);
30+extern void autopick_pickup_items(grid_type *g_ptr);
31+extern bool autopick_autoregister(object_type *o_ptr);
32+extern void do_cmd_edit_autopick(void);
--- a/src/birth.c
+++ b/src/birth.c
@@ -36,6 +36,7 @@
3636 #include "world.h"
3737 #include "objectkind.h"
3838 #include "monsterrace.h"
39+#include "autopick.h"
3940
4041 /*!
4142 * オートローラーの内容を描画する間隔 /
--- a/src/bldg.c
+++ b/src/bldg.c
@@ -18,6 +18,7 @@
1818 #include "floor.h"
1919 #include "floor-events.h"
2020 #include "floor-save.h"
21+#include "autopick.h"
2122 #include "objectkind.h"
2223 #include "object-boost.h"
2324 #include "object-flavor.h"
@@ -49,6 +50,7 @@
4950 #include "shoot.h"
5051 #include "view-mainwindow.h"
5152 #include "monsterrace.h"
53+#include "autopick.h"
5254
5355
5456 /*
--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -13,6 +13,7 @@
1313
1414 #include "angband.h"
1515 #include "util.h"
16+#include "autopick.h"
1617
1718 #include "selfinfo.h"
1819 #include "cmd-activate.h"
@@ -37,6 +38,7 @@
3738 #include "view-mainwindow.h"
3839 #include "spells.h"
3940 #include "objectkind.h"
41+#include "autopick.h"
4042
4143
4244 /*!
--- a/src/cmd-smith.c
+++ b/src/cmd-smith.c
@@ -6,6 +6,7 @@
66 #include "player-status.h"
77 #include "cmd-basic.h"
88 #include "objectkind.h"
9+#include "autopick.h"
910
1011
1112
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -35,6 +35,7 @@
3535 #include "cmd-basic.h"
3636 #include "view-mainwindow.h"
3737 #include "floor.h"
38+#include "autopick.h"
3839
3940 /*!
4041 * @brief
--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -41,6 +41,7 @@
4141
4242 #include "angband.h"
4343 #include "util.h"
44+#include "autopick.h"
4445
4546 #include "birth.h"
4647 #include "cmd-pet.h"
--- a/src/core.c
+++ b/src/core.c
@@ -69,6 +69,7 @@
6969 #include "files.h"
7070 #include "player-effects.h"
7171 #include "scores.h"
72+#include "autopick.h"
7273
7374 static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/
7475 static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/
--- a/src/externs.h
+++ b/src/externs.h
@@ -32,12 +32,6 @@ extern concptr macro_trigger_keycode[2][MAX_MACRO_TRIG];
3232
3333 extern int level_up;
3434
35-/*
36- * List for auto-picker/destroyer entries
37- */
38-extern int max_autopick;
39-extern int max_max_autopick;
40-extern autopick_type *autopick_list;
4135
4236 /* tables.c */
4337 extern const POSITION ddd[9];
@@ -305,17 +299,6 @@ extern FEAT_IDX feat_ground_type[100], feat_wall_type[100];
305299 extern COMMAND_CODE now_message;
306300 extern bool use_menu;
307301
308-/* autopick.c */
309-extern void autopick_load_pref(bool disp_mes);
310-extern errr process_autopick_file_command(char *buf);
311-extern concptr autopick_line_from_entry(autopick_type *entry);
312-extern int is_autopick(object_type *o_ptr);
313-extern void autopick_alter_item(INVENTORY_IDX item, bool destroy);
314-extern void autopick_delayed_alter(void);
315-extern void autopick_pickup_items(grid_type *g_ptr);
316-extern bool autopick_autoregister(object_type *o_ptr);
317-extern void do_cmd_edit_autopick(void);
318-
319302
320303 /* grids.c */
321304 extern void update_local_illumination(POSITION y, POSITION x);
--- a/src/files.c
+++ b/src/files.c
@@ -52,6 +52,7 @@
5252 #include "dungeon.h"
5353 #include "melee.h"
5454 #include "objectkind.h"
55+#include "autopick.h"
5556
5657
5758 /*
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -39,6 +39,7 @@
3939 #include "monster-spell.h"
4040 #include "world.h"
4141 #include "objectkind.h"
42+#include "autopick.h"
4243
4344 /*!
4445 * @brief プレイヤーの継続行動を設定する。
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -142,6 +142,7 @@
142142 #include "angband.h"
143143 #include "util.h"
144144
145+#include "autopick.h"
145146 #include "dungeon.h"
146147 #include "floor.h"
147148 #include "melee.h"
@@ -165,6 +166,7 @@
165166 #include "view-mainwindow.h"
166167 #include "world.h"
167168 #include "objectkind.h"
169+#include "autopick.h"
168170
169171
170172 #ifdef TRAVEL
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -26,6 +26,7 @@
2626 #include "player-class.h"
2727 #include "objectkind.h"
2828 #include "monsterrace.h"
29+#include "autopick.h"
2930
3031 /*!
3132 * @var horror_desc
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -15,6 +15,7 @@
1515 #include "player-effects.h"
1616 #include "player-class.h"
1717 #include "objectkind.h"
18+#include "autopick.h"
1819
1920
2021 typedef struct
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -17,6 +17,7 @@
1717 #include "cmd-pet.h"
1818 #include "floor.h"
1919 #include "trap.h"
20+#include "autopick.h"
2021 #include "object-curse.h"
2122 #include "player-damage.h"
2223 #include "player-effects.h"
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -31,6 +31,7 @@
3131 #include "spells-status.h"
3232 #include "spells-floor.h"
3333 #include "realm-hex.h"
34+#include "autopick.h"
3435 #include "object-flavor.h"
3536 #include "object-hook.h"
3637 #include "monster-status.h"
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -45,6 +45,7 @@
4545 #include "wild.h"
4646 #include "world.h"
4747 #include "objectkind.h"
48+#include "autopick.h"
4849
4950
5051 /*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
--- a/src/store.c
+++ b/src/store.c
@@ -33,6 +33,7 @@
3333 #include "mind.h"
3434 #include "world.h"
3535 #include "objectkind.h"
36+#include "autopick.h"
3637
3738 #define MIN_STOCK 12
3839
--- a/src/types.h
+++ b/src/types.h
@@ -392,20 +392,6 @@ typedef struct
392392 }
393393 feat_prob;
394394
395-
396-/*!
397- * @struct autopick_type
398- * @brief 自動拾い/破壊設定データの構造体 / A structure type for entry of auto-picker/destroyer
399- */
400-typedef struct {
401- concptr name; /*!< 自動拾い/破壊定義の名称一致基準 / Items which have 'name' as part of its name match */
402- concptr insc; /*!< 対象となったアイテムに自動で刻む内容 / Items will be auto-inscribed as 'insc' */
403- BIT_FLAGS flag[2]; /*!< キーワードに関する汎用的な条件フラグ / Misc. keyword to be matched */
404- byte action; /*!< 対象のアイテムを拾う/破壊/放置するかの指定フラグ / Auto-pickup or Destroy or Leave items */
405- byte dice; /*!< 武器のダイス値基準値 / Weapons which have more than 'dice' dice match */
406- byte bonus; /*!< アイテムのボーナス基準値 / Items which have more than 'bonus' magical bonus match */
407-} autopick_type;
408-
409395 typedef struct {
410396 int flag;
411397 int type;
--- a/src/variable.c
+++ b/src/variable.c
@@ -36,13 +36,6 @@ concptr macro_trigger_keycode[2][MAX_MACRO_TRIG]; /*!< マクロの内容 */
3636 int level_up = 0; /*!< レベルアップの際に遅延してcalc_mana()関数上で上昇量を表示するかどうかの判定フラグ */
3737
3838
39-/*
40- * 自動拾い/破壊設定のリストに関する変数 / List for auto-picker/destroyer entries
41- */
42-int max_autopick = 0; /*!< 現在登録している自動拾い/破壊設定の数 */
43-int max_max_autopick = 0; /*!< 自動拾い/破壊設定の限界数 */
44-autopick_type *autopick_list = NULL; /*!< 自動拾い/破壊設定構造体のポインタ配列 */
45-
4639 /*
4740 * Savefile version
4841 */
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -12,6 +12,7 @@
1212
1313 #include "angband.h"
1414 #include "util.h"
15+#include "autopick.h"
1516
1617 #include "files.h"
1718 #include "world.h"
Show on old repository browser