From: deskull Date: Thu, 2 May 2019 02:06:29 +0000 (+0900) Subject: [Refactor] #37353 floor-town.c/h を作成して関連構造体と変数を移動. X-Git-Url: http://git.osdn.net/view?p=hengband%2Fhengband.git;a=commitdiff_plain;h=77371e00cdedc0163dd1a8281d1b6752916166ee [Refactor] #37353 floor-town.c/h を作成して関連構造体と変数を移動. --- diff --git a/Hengband_vcs2017/Hengband/Hengband.vcxproj b/Hengband_vcs2017/Hengband/Hengband.vcxproj index fbf384708..2cba95205 100644 --- a/Hengband_vcs2017/Hengband/Hengband.vcxproj +++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj @@ -157,6 +157,7 @@ + @@ -302,6 +303,7 @@ + diff --git a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters index bc957f395..03afedc8c 100644 --- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters +++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters @@ -333,6 +333,9 @@ object + + floor + @@ -632,6 +635,9 @@ object + + floor + diff --git a/src/birth.c b/src/birth.c index bef4cdbb9..ad2c1c026 100644 --- a/src/birth.c +++ b/src/birth.c @@ -30,6 +30,7 @@ #include "floor.h" #include "cmd-pet.h" #include "dungeon-file.h" +#include "floor-town.h" #include "files.h" #include "birth.h" #include "player-skill.h" diff --git a/src/cmd4.c b/src/cmd4.c index 0668336b4..6d516fb2c 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -69,6 +69,7 @@ #include "player-move.h" #include "spells.h" #include "objectkind.h" +#include "floor-town.h" /* */ diff --git a/src/core.c b/src/core.c index 614bc1afd..93b4ab95a 100644 --- a/src/core.c +++ b/src/core.c @@ -33,6 +33,7 @@ #include "dungeon.h" #include "floor.h" #include "floor-events.h" +#include "floor-town.h" #include "grid.h" #include "object-curse.h" #include "object-flavor.h" diff --git a/src/dungeon-file.c b/src/dungeon-file.c index 1a769983f..923476ac3 100644 --- a/src/dungeon-file.c +++ b/src/dungeon-file.c @@ -17,6 +17,7 @@ #include "objectkind.h" #include "object-ego.h" #include "monsterrace.h" +#include "floor-town.h" dungeon_grid letter[255]; diff --git a/src/externs.h b/src/externs.h index c9c4ccb3d..214a85cf0 100644 --- a/src/externs.h +++ b/src/externs.h @@ -211,8 +211,6 @@ extern const concptr angband_sound_name[SOUND_MAX]; extern const concptr angband_music_basic_name[MUSIC_BASIC_MAX]; extern FLOOR_IDX max_floor_id; extern u32b saved_floor_file_sign; -extern TOWN_IDX max_towns; -extern town_type *town_info; extern s16b alloc_kind_size; extern alloc_entry *alloc_kind_table; extern s16b alloc_race_size; diff --git a/src/files.c b/src/files.c index cc499546f..a01883d02 100644 --- a/src/files.c +++ b/src/files.c @@ -45,6 +45,7 @@ #include "term.h" #include "view-mainwindow.h" #include "floor-events.h" +#include "floor-town.h" #include "dungeon-file.h" #include "init.h" #include "monster-spell.h" diff --git a/src/floor-town.c b/src/floor-town.c new file mode 100644 index 000000000..5faa3bdc4 --- /dev/null +++ b/src/floor-town.c @@ -0,0 +1,12 @@ +#include "angband.h" +#include "floor-town.h" + +/* + * Maximum number of towns + */ +TOWN_IDX max_towns; + +/* + * The towns [max_towns] + */ +town_type *town_info; diff --git a/src/floor-town.h b/src/floor-town.h new file mode 100644 index 000000000..c0ceeeac3 --- /dev/null +++ b/src/floor-town.h @@ -0,0 +1,17 @@ +#pragma once + +/* + * A structure describing a town with + * stores and buildings + */ +typedef struct town_type town_type; +struct town_type +{ + GAME_TEXT name[32]; + u32b seed; /* Seed for RNG */ + store_type *store; /* The stores [MAX_STORES] */ + byte numstores; +}; + +extern TOWN_IDX max_towns; +extern town_type *town_info; diff --git a/src/init.c b/src/init.c index 36fcac56d..11baefd7a 100644 --- a/src/init.c +++ b/src/init.c @@ -47,6 +47,7 @@ #include "files.h" #include "feature.h" #include "floor.h" +#include "floor-town.h" #include "dungeon.h" #include "rooms-vault.h" #include "player-skill.h" diff --git a/src/load.c b/src/load.c index 0db32b03c..0c16f326d 100644 --- a/src/load.c +++ b/src/load.c @@ -59,8 +59,9 @@ #include "wild.h" #include "patron.h" -#include "floor-save.h" #include "floor.h" +#include "floor-save.h" +#include "floor-town.h" #include "grid.h" #include "cmd-pet.h" diff --git a/src/rumor.c b/src/rumor.c index 82efca206..0271943ff 100644 --- a/src/rumor.c +++ b/src/rumor.c @@ -6,6 +6,7 @@ #include "artifact.h" #include "dungeon.h" #include "monsterrace.h" +#include "floor-town.h" /* * Display a rumor and apply its effects diff --git a/src/save.c b/src/save.c index e7469ed07..2c703d923 100644 --- a/src/save.c +++ b/src/save.c @@ -22,6 +22,7 @@ #include "floor.h" #include "floor-events.h" #include "floor-save.h" +#include "floor-town.h" #include "files.h" #include "world.h" #include "objectkind.h" diff --git a/src/spells3.c b/src/spells3.c index ad86f00a2..edcc74d57 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -17,6 +17,7 @@ #include "dungeon.h" #include "floor.h" +#include "floor-town.h" #include "object-boost.h" #include "object-flavor.h" #include "object-hook.h" diff --git a/src/store.c b/src/store.c index 57bb55978..c4e237326 100644 --- a/src/store.c +++ b/src/store.c @@ -34,6 +34,7 @@ #include "world.h" #include "objectkind.h" #include "autopick.h" +#include "floor-town.h" #define MIN_STOCK 12 diff --git a/src/types.h b/src/types.h index 6df442d3e..5dccb16cf 100644 --- a/src/types.h +++ b/src/types.h @@ -300,19 +300,6 @@ struct monster_power /* - * A structure describing a town with - * stores and buildings - */ -typedef struct town_type town_type; -struct town_type -{ - GAME_TEXT name[32]; - u32b seed; /* Seed for RNG */ - store_type *store; /* The stores [MAX_STORES] */ - byte numstores; -}; - -/* * Sort-array element */ typedef struct tag_type tag_type; diff --git a/src/variable.c b/src/variable.c index e607768cf..d271f2254 100644 --- a/src/variable.c +++ b/src/variable.c @@ -413,16 +413,6 @@ FLOOR_IDX max_floor_id; u32b saved_floor_file_sign; /* - * Maximum number of towns - */ -TOWN_IDX max_towns; - -/* - * The towns [max_towns] - */ -town_type *town_info; - -/* * The size of "alloc_kind_table" (at most max_k_idx * 4) */ s16b alloc_kind_size; diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index 8891074ae..dbab0347d 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -32,6 +32,7 @@ #include "grid.h" #include "dungeon.h" #include "floor.h" +#include "floor-town.h" #include "feature.h" #include "objectkind.h" diff --git a/src/wild.c b/src/wild.c index d9bcd121b..65e61adaf 100644 --- a/src/wild.c +++ b/src/wild.c @@ -27,6 +27,7 @@ #include "dungeon-file.h" #include "files.h" #include "feature.h" +#include "floor-town.h" /* * Wilderness diff --git a/src/wizard1.c b/src/wizard1.c index 58da53c9b..8efcf535f 100644 --- a/src/wizard1.c +++ b/src/wizard1.c @@ -20,6 +20,7 @@ #include "object-flavor.h" #include "object-hook.h" #include "objectkind.h" +#include "floor-town.h" #ifdef ALLOW_SPOILERS diff --git a/src/xtra2.c b/src/xtra2.c index ff188721b..29da22887 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -27,6 +27,7 @@ #include "grid.h" #include "floor.h" #include "floor-events.h" +#include "floor-town.h" #include "player-move.h" #include "player-status.h" #include "monster-status.h"