From c06ca8f2cbf2a94cf0ffa596e420a478080a3aac Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 21 Apr 2020 19:04:39 +0900 Subject: [PATCH] [Refactor] #40275 Separated building-util.c/h from bldg.c/h --- Hengband_vcs2017/Hengband/Hengband.vcxproj | 2 ++ Hengband_vcs2017/Hengband/Hengband.vcxproj.filters | 6 ++++++ src/Makefile.am | 1 + src/bldg.c | 17 +---------------- src/bldg.h | 1 - src/market/building-util.c | 17 +++++++++++++++++ src/market/building-util.h | 3 +++ src/spells3.c | 1 + 8 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 src/market/building-util.c create mode 100644 src/market/building-util.h diff --git a/Hengband_vcs2017/Hengband/Hengband.vcxproj b/Hengband_vcs2017/Hengband/Hengband.vcxproj index f10fde7cc..7e2602087 100644 --- a/Hengband_vcs2017/Hengband/Hengband.vcxproj +++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj @@ -212,6 +212,7 @@ + @@ -391,6 +392,7 @@ + diff --git a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters index 5afd048c7..1b21fb158 100644 --- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters +++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters @@ -565,6 +565,9 @@ cmd + + market + @@ -1112,6 +1115,9 @@ cmd + + market + diff --git a/src/Makefile.am b/src/Makefile.am index 8b2597938..e09326d12 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,7 @@ hengband_SOURCES = \ \ avatar.h avatar.c birth.c birth.h \ \ + market/building-util.c market/building-util.h \ market/poker.c market/poker.h market/store-owners.c market/store-owners.h \ market/store-owner-comments.c market/store-owner-comments.h \ market/articles-on-sale.c market/articles-on-sale.h \ diff --git a/src/bldg.c b/src/bldg.c index 26a600fa8..09d1f7c8e 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -63,6 +63,7 @@ #include "autopick.h" #include "market/poker.h" +#include "market/building-util.h" /* * todo MAX_BLDGが定義されていない旨のエラーが出る……がコンパイルには成功する @@ -204,22 +205,6 @@ static bool is_member(player_type *player_ptr, building_type *bldg) /*! - * @brief コンソールに表示された施設に関する情報を消去する / Clear the building information - * @details 消去は行毎にヌル文字列で行われる。 - * @param min_row 開始行番号 - * @param max_row 末尾行番号 - * @return なし - */ -void clear_bldg(int min_row, int max_row) -{ - for (int i = min_row; i <= max_row; i++) - { - prt("", i, 0); - } -} - - -/*! * @brief 所持金を表示する。 * @param player_ptr プレーヤーへの参照ポインタ * @return なし diff --git a/src/bldg.h b/src/bldg.h index b91f47fc9..6db9f6401 100644 --- a/src/bldg.h +++ b/src/bldg.h @@ -118,6 +118,5 @@ extern const arena_type arena_info[MAX_ARENA_MONS + 2]; extern void update_gambling_monsters(player_type *player_ptr); extern void do_cmd_bldg(player_type *player_ptr); -extern void clear_bldg(int min_row, int max_row); extern void determine_daily_bounty(player_type *player_ptr, bool conv_old); extern void determine_bounty_uniques(player_type *player_ptr); diff --git a/src/market/building-util.c b/src/market/building-util.c new file mode 100644 index 000000000..eef057aa3 --- /dev/null +++ b/src/market/building-util.c @@ -0,0 +1,17 @@ +#include "angband.h" +#include "market/building-util.h" + +/*! + * @brief コンソールに表示された施設に関する情報を消去する / Clear the building information + * @details 消去は行毎にヌル文字列で行われる。 + * @param min_row 開始行番号 + * @param max_row 末尾行番号 + * @return なし + */ +void clear_bldg(int min_row, int max_row) +{ + for (int i = min_row; i <= max_row; i++) + { + prt("", i, 0); + } +} diff --git a/src/market/building-util.h b/src/market/building-util.h new file mode 100644 index 000000000..4c823bb84 --- /dev/null +++ b/src/market/building-util.h @@ -0,0 +1,3 @@ +#pragma once + +void clear_bldg(int min_row, int max_row); diff --git a/src/spells3.c b/src/spells3.c index 9c42fa091..85951bd65 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -39,6 +39,7 @@ #include "spells.h" #include "spells-floor.h" #include "grid.h" +#include "market/building-util.h" #include "monster-process.h" #include "monster-status.h" #include "monster-spell.h" -- 2.11.0