OSDN Git Service

[Refactor] #40577 Moved permanent_wall() from cave.c/h to feature.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 25 Jul 2020 08:36:22 +0000 (17:36 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 26 Jul 2020 08:04:23 +0000 (17:04 +0900)
src/action/movement-execution.c
src/floor/cave.c
src/floor/cave.h
src/grid/feature.c
src/grid/feature.h

index 82e569d..c4267dd 100644 (file)
@@ -5,7 +5,6 @@
 #include "core/disturbance.h"
 #include "core/player-update-types.h"
 #include "core/stuff-handler.h"
-#include "floor/cave.h"
 #include "floor/floor.h"
 #include "floor/pattern-walk.h"
 #include "game-option/input-options.h"
index cf4ab4b..b61aca2 100644 (file)
@@ -106,11 +106,6 @@ bool cave_los_grid(grid_type *grid_ptr) { return feat_supports_los(grid_ptr->fea
 bool cave_have_flag_grid(grid_type *grid_ptr, int feature_flags) { return have_flag(f_info[grid_ptr->feat].flags, feature_flags); }
 
 /*
- * Determine if a "feature" is "permanent wall"
- */
-bool permanent_wall(feature_type *f_ptr) { return have_flag(f_ptr->flags, FF_WALL) && have_flag(f_ptr->flags, FF_PERMANENT); }
-
-/*
  * Determine if a "legal" grid is a "clean" floor grid
  * Determine if terrain-change spells are allowed in a grid.
  *
@@ -120,5 +115,6 @@ bool permanent_wall(feature_type *f_ptr) { return have_flag(f_ptr->flags, FF_WAL
  */
 bool cave_clean_bold(floor_type *floor_ptr, POSITION y, POSITION x)
 {
-    return cave_have_flag_bold(floor_ptr, y, x, FF_FLOOR) && ((floor_ptr->grid_array[y][x].info & CAVE_OBJECT) == 0) && (floor_ptr->grid_array[y][x].o_idx == 0);
+    return cave_have_flag_bold(floor_ptr, y, x, FF_FLOOR) && ((floor_ptr->grid_array[y][x].info & CAVE_OBJECT) == 0)
+        && (floor_ptr->grid_array[y][x].o_idx == 0);
 }
index 0bad8c8..d7f6ea5 100644 (file)
@@ -3,7 +3,6 @@
 #include "system/angband.h"
 
 typedef enum feature_flag_type feature_flag_type;
-typedef struct feature_type feature_type;
 typedef struct grid_type grid_type;
 bool in_bounds(floor_type *floor_ptr, POSITION y, POSITION x);
 bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x);
@@ -18,5 +17,4 @@ bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x);
 bool feat_supports_los(FEAT_IDX f_idx);
 bool cave_los_grid(grid_type *grid_ptr);
 bool cave_have_flag_grid(grid_type *grid_ptr, int feature_flags);
-bool permanent_wall(feature_type *f_ptr);
 bool cave_clean_bold(floor_type *floor_ptr, POSITION y, POSITION x);
index 7a09c38..a8a1017 100644 (file)
@@ -152,3 +152,8 @@ void apply_default_feat_lighting(TERM_COLOR *f_attr, SYMBOL_CODE *f_char)
  * Not using graphical tiles for this feature?
  */
 bool is_ascii_graphics(char x) { return (x & 0x80) == 0; }
+
+/*
+ * Determine if a "feature" is "permanent wall"
+ */
+bool permanent_wall(feature_type *f_ptr) { return have_flag(f_ptr->flags, FF_WALL) && have_flag(f_ptr->flags, FF_PERMANENT); }
index 7e0fb1a..1673e70 100644 (file)
@@ -119,3 +119,4 @@ bool is_closed_door(player_type *player_ptr, FEAT_IDX feat);
 bool is_trap(player_type *player_ptr, FEAT_IDX feat);
 void apply_default_feat_lighting(TERM_COLOR *f_attr, SYMBOL_CODE *f_char);
 bool is_ascii_graphics(char x);
+bool permanent_wall(feature_type *f_ptr);