From 939d989185f4a4d1db79f79d294ad96a82e7f53e Mon Sep 17 00:00:00 2001 From: Hourier Date: Tue, 4 Aug 2020 18:16:31 +0900 Subject: [PATCH] [Refactor] #40572 Separated floor-allocation-types.h --- Hengband/Hengband/Hengband.vcxproj | 1 + Hengband/Hengband/Hengband.vcxproj.filters | 3 +++ src/Makefile.am | 1 + src/floor/floor-allocation-types.h | 17 +++++++++++++++++ src/floor/floor-generate.c | 1 + src/floor/floor-generate.h | 16 ---------------- 6 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 src/floor/floor-allocation-types.h diff --git a/Hengband/Hengband/Hengband.vcxproj b/Hengband/Hengband/Hengband.vcxproj index 924720ace..529f683cf 100644 --- a/Hengband/Hengband/Hengband.vcxproj +++ b/Hengband/Hengband/Hengband.vcxproj @@ -788,6 +788,7 @@ + diff --git a/Hengband/Hengband/Hengband.vcxproj.filters b/Hengband/Hengband/Hengband.vcxproj.filters index 158d05845..f47386ecd 100644 --- a/Hengband/Hengband/Hengband.vcxproj.filters +++ b/Hengband/Hengband/Hengband.vcxproj.filters @@ -4276,6 +4276,9 @@ wizard + + floor + diff --git a/src/Makefile.am b/src/Makefile.am index 229e554a1..2c8187905 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -205,6 +205,7 @@ hengband_SOURCES = \ floor/cave.c floor/cave.h \ floor/fixed-map-generator.c floor/fixed-map-generator.h \ floor/floor.c floor/floor.h \ + floor/floor-allocation-types.h \ floor/floor-base-definitions.h \ floor/floor-events.c floor/floor-events.h \ floor/floor-generate.c floor/floor-generate.h \ diff --git a/src/floor/floor-allocation-types.h b/src/floor/floor-allocation-types.h new file mode 100644 index 000000000..916b79414 --- /dev/null +++ b/src/floor/floor-allocation-types.h @@ -0,0 +1,17 @@ +#pragma once + +/* Dungeon allocation "places" */ +typedef enum dap_type { + ALLOC_SET_CORR = 1, /* Hallway */ + ALLOC_SET_ROOM = 2, /* Room */ + ALLOC_SET_BOTH = 3, /* Anywhere */ +} dap_type; + +/* Dungeon allocation "types" */ +typedef enum dungeon_allocation_type { + ALLOC_TYP_RUBBLE = 1, /* Rubble */ + ALLOC_TYP_TRAP = 3, /* Trap */ + ALLOC_TYP_GOLD = 4, /* Gold */ + ALLOC_TYP_OBJECT = 5, /* Object */ + ALLOC_TYP_INVIS = 6, /* Invisible wall */ +} dungeon_allocation_type; diff --git a/src/floor/floor-generate.c b/src/floor/floor-generate.c index 3db27d17c..e1c482ba3 100644 --- a/src/floor/floor-generate.c +++ b/src/floor/floor-generate.c @@ -17,6 +17,7 @@ #include "dungeon/dungeon.h" #include "dungeon/quest.h" #include "floor/cave.h" +#include "floor/floor-allocation-types.h" #include "floor/floor-events.h" #include "floor/floor-generate.h" #include "floor/floor-save.h" diff --git a/src/floor/floor-generate.h b/src/floor/floor-generate.h index 598945dbc..accc8c3d8 100644 --- a/src/floor/floor-generate.h +++ b/src/floor/floor-generate.h @@ -10,22 +10,6 @@ extern int dun_tun_con; /*!< ダンジョンの通路を継続して引き延ば extern int dun_tun_pen; /*!< ダンジョンの部屋入口にドアを設置する頻度(一回の試行ごとに%で判定している) */ extern int dun_tun_jct; /*!< ダンジョンの通路交差地点付近にドアを設置する頻度(一回の試行ごとに%で判定している) */ -/* - * Hack -- Dungeon allocation "places" - */ -#define ALLOC_SET_CORR 1 /* Hallway */ -#define ALLOC_SET_ROOM 2 /* Room */ -#define ALLOC_SET_BOTH 3 /* Anywhere */ - -/* - * Hack -- Dungeon allocation "types" - */ -#define ALLOC_TYP_RUBBLE 1 /* Rubble */ -#define ALLOC_TYP_TRAP 3 /* Trap */ -#define ALLOC_TYP_GOLD 4 /* Gold */ -#define ALLOC_TYP_OBJECT 5 /* Object */ -#define ALLOC_TYP_INVIS 6 /* Invisible wall */ - bool place_quest_monsters(player_type *creature_ptr); void wipe_generate_random_floor_flags(floor_type *floor_ptr); void clear_cave(player_type *player_ptr); -- 2.11.0