OSDN Git Service

[Refactor] #40577 Moved pattern_tile() from floor.c/h to cave.c/h
authorHourier <hourier@users.sourceforge.jp>
Thu, 20 Aug 2020 07:40:12 +0000 (16:40 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 20 Aug 2020 07:40:12 +0000 (16:40 +0900)
src/floor/cave.c
src/floor/cave.h
src/floor/floor.c
src/floor/floor.h
src/floor/pattern-walk.c
src/monster-floor/one-monster-placer.c
src/player/player-status.c

index df5a326..a085905 100644 (file)
@@ -129,3 +129,5 @@ bool cave_drop_bold(floor_type *floor_ptr, POSITION y, POSITION x)
 {
     return cave_have_flag_bold(floor_ptr, y, x, FF_DROP) && ((floor_ptr->grid_array[y][x].info & CAVE_OBJECT) == 0);
 }
+
+bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x) { return cave_have_flag_bold(floor_ptr, y, x, FF_PATTERN); }
index a6e5318..b0fcdc6 100644 (file)
@@ -19,3 +19,4 @@ bool cave_los_grid(grid_type *grid_ptr);
 bool cave_have_flag_grid(grid_type *grid_ptr, int feature_flags);
 bool cave_clean_bold(floor_type *floor_ptr, POSITION y, POSITION x);
 bool cave_drop_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x);
index 2a97388..9149d8b 100644 (file)
@@ -9,7 +9,6 @@
 #include "effect/spells-effect-util.h"
 #include "floor/cave.h"
 #include "floor/floor-generator-util.h"
-#include "floor/floor-generator.h" // todo 相互依存している、後で消す.
 #include "floor/floor-object.h"
 #include "game-option/birth-options.h"
 #include "game-option/cheat-options.h"
@@ -43,8 +42,6 @@
  */
 floor_type floor_info;
 
-bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x) { return cave_have_flag_bold(floor_ptr, y, x, FF_PATTERN); }
-
 /*!
  * @brief 鍵のかかったドアを配置する
  * @param player_ptr プレーヤーへの参照ポインタ
@@ -894,45 +891,6 @@ void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num)
  * @param x2 終点X座標
  * @param flg フラグID
  * @return リストの長さ
- * @details
- * <pre>
- * The projection will always start from the grid (y1,x1), and will travel
- * towards the grid (y2,x2), touching one grid per unit of distance along
- * the major axis, and stopping when it enters the destination grid or a
- * wall grid, or has travelled the maximum legal distance of "range".
- *
- * Note that "distance" in this function (as in the "update_view()" code)
- * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
- * actually has an "octagon of projection" not a "circle of projection".
- *
- * The path grids are saved into the grid array pointed to by "gp", and
- * there should be room for at least "range" grids in "gp".  Note that
- * due to the way in which distance is calculated, this function normally
- * uses fewer than "range" grids for the projection path, so the result
- * of this function should never be compared directly to "range".  Note
- * that the initial grid (y1,x1) is never saved into the grid array, not
- * even if the initial grid is also the final grid.
- *
- * The "flg" flags can be used to modify the behavior of this function.
- *
- * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
- * semantics as they do for the "project" function, namely, that the path
- * will stop as soon as it hits a monster, or that the path will continue
- * through the destination grid, respectively.
- *
- * The "PROJECT_JUMP" flag, which for the "project()" function means to
- * start at a special grid (which makes no sense in this function), means
- * that the path should be "angled" slightly if needed to avoid any wall
- * grids, allowing the player to "target" any grid which is in "view".
- * This flag is non-trivial and has not yet been implemented, but could
- * perhaps make use of the "vinfo" array (above).
- *
- * This function returns the number of grids (if any) in the path.  This
- * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
- *
- * This algorithm is similar to, but slightly different from, the one used
- * by "update_view_los()", and very different from the one used by "los()".
- * </pre>
  */
 int project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
 {
index 7811690..1ebad18 100644 (file)
@@ -22,7 +22,6 @@ extern floor_type floor_info;
 #define GRID_X(G) \
        ((int)((G) % 256U))
 
-bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x);
 void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
 void add_door(player_type *player_ptr, POSITION x, POSITION y);
 void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
index 094b453..5156e9f 100644 (file)
@@ -3,6 +3,7 @@
 #include "core/asking-player.h"
 #include "dungeon/dungeon.h"
 #include "dungeon/quest.h"
+#include "floor/cave.h"
 #include "floor/floor-mode-changer.h"
 #include "floor/floor.h"
 #include "game-option/birth-options.h"
index 69cf8ca..c637fce 100644 (file)
@@ -14,7 +14,6 @@
 #include "flavor/object-flavor-types.h"
 #include "floor/cave.h"
 #include "floor/floor-save-util.h"
-#include "floor/floor.h"
 #include "game-option/birth-options.h"
 #include "game-option/cheat-types.h"
 #include "grid/grid.h"
index e1c3a6f..dbe3754 100644 (file)
@@ -18,6 +18,7 @@
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
 #include "dungeon/quest.h"
+#include "floor/cave.h"
 #include "floor/floor-events.h"
 #include "floor/floor-leaver.h"
 #include "floor/floor-save.h"