* @param trapped TRUEならばトラップが存在する箱のみ、FALSEならば空でない箱全てを対象にする
* @return 箱が存在する場合そのオブジェクトID、存在しない場合0を返す。
*/
-OBJECT_IDX chest_check(floor_type *floor_ptr, POSITION y, POSITION x, bool trapped)
+OBJECT_IDX chest_check(FloorType *floor_ptr, POSITION y, POSITION x, bool trapped)
{
auto *g_ptr = &floor_ptr->grid_array[y][x];
for (const auto this_o_idx : g_ptr->o_idx_list) {
#include "system/angband.h"
-struct floor_type;
+class FloorType;
class PlayerType;
-OBJECT_IDX chest_check(floor_type *floor_ptr, POSITION y, POSITION x, bool trapped);
+OBJECT_IDX chest_check(FloorType *floor_ptr, POSITION y, POSITION x, bool trapped);
int count_chests(PlayerType *player_ptr, POSITION *y, POSITION *x, bool trapped);
* @brief トラベル処理の記憶配列を初期化する Hack: forget the "flow" information
* @param player_ptr プレイヤーへの参照ポインタ
*/
-void forget_travel_flow(floor_type *floor_ptr)
+void forget_travel_flow(FloorType *floor_ptr)
{
for (POSITION y = 0; y < floor_ptr->height; y++) {
for (POSITION x = 0; x < floor_ptr->width; x++) {
extern travel_type travel;
-struct floor_type;
+class FloorType;
class PlayerType;
void travel_step(PlayerType *player_ptr);
-void forget_travel_flow(floor_type *floor_ptr);
+void forget_travel_flow(FloorType *floor_ptr);
* @param x 対象を行うマスのX座標
* @return
*/
-static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x)
+static bool do_cmd_tunnel_test(FloorType *floor_ptr, POSITION y, POSITION x)
{
auto *g_ptr = &floor_ptr->grid_array[y][x];
if (!g_ptr->is_mark()) {
* @param i1 オブジェクト移動元の要素番号
* @param i2 オブジェクト移動先の要素番号
*/
-static void compact_objects_aux(floor_type *floor_ptr, OBJECT_IDX i1, OBJECT_IDX i2)
+static void compact_objects_aux(FloorType *floor_ptr, OBJECT_IDX i1, OBJECT_IDX i2)
{
if (i1 == i2) {
return;
#include "util/bit-flags-calculator.h"
#include "wizard/wizard-messages.h"
-static void reset_lite_area(floor_type *floor_ptr)
+static void reset_lite_area(FloorType *floor_ptr)
{
floor_ptr->lite_n = 0;
floor_ptr->mon_lite_n = 0;
}
}
-static void make_only_tunnel_points(floor_type *floor_ptr, dun_data_type *dd_ptr)
+static void make_only_tunnel_points(FloorType *floor_ptr, dun_data_type *dd_ptr)
{
int point_num = (floor_ptr->width * floor_ptr->height) / 200 + randint1(3);
dd_ptr->cent_n = point_num;
return false;
}
-static void decide_grid_glowing(floor_type *floor_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr)
+static void decide_grid_glowing(FloorType *floor_ptr, dun_data_type *dd_ptr, dungeon_type *d_ptr)
{
bool is_empty_or_dark = dd_ptr->empty_level;
is_empty_or_dark &= !one_in_(DARK_EMPTY) || (randint1(100) > floor_ptr->dun_level);
/*
* Determines if a map location is fully inside the outer walls
*/
-bool in_bounds(floor_type *floor_ptr, POSITION y, POSITION x)
+bool in_bounds(FloorType *floor_ptr, POSITION y, POSITION x)
{
return (y > 0) && (x > 0) && (y < floor_ptr->height - 1) && (x < floor_ptr->width - 1);
}
/*
* Determines if a map location is on or inside the outer walls
*/
-bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x)
+bool in_bounds2(FloorType *floor_ptr, POSITION y, POSITION x)
{
return (y >= 0) && (x >= 0) && (y < floor_ptr->height) && (x < floor_ptr->width);
}
* Determines if a map location is on or inside the outer walls
* (unsigned version)
*/
-bool in_bounds2u(floor_type *floor_ptr, POSITION y, POSITION x)
+bool in_bounds2u(FloorType *floor_ptr, POSITION y, POSITION x)
{
return (y < floor_ptr->height) && (x < floor_ptr->width);
}
return is_empty_grid;
}
-bool cave_has_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, TerrainCharacteristics f_idx)
+bool cave_has_flag_bold(FloorType *floor_ptr, POSITION y, POSITION x, TerrainCharacteristics f_idx)
{
return terrains_info[floor_ptr->grid_array[y][x].feat].flags.has(f_idx);
}
/*
* Does the grid stop disintegration?
*/
-bool cave_stop_disintegration(floor_type *floor_ptr, POSITION y, POSITION x)
+bool cave_stop_disintegration(FloorType *floor_ptr, POSITION y, POSITION x)
{
return !cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::PROJECT) && (!cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::HURT_DISI) || cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::PERMANENT));
}
* @param x 指定X座標
* @return 光を通すならばtrueを返す。
*/
-bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+bool cave_los_bold(FloorType *floor_ptr, POSITION y, POSITION x)
{
return feat_supports_los(floor_ptr->grid_array[y][x].feat);
}
* Line 2 -- forbid object terrains
* Line 3 -- forbid normal objects
*/
-bool cave_clean_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+bool cave_clean_bold(FloorType *floor_ptr, POSITION y, POSITION x)
{
return cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::FLOOR) && ((floor_ptr->grid_array[y][x].is_object()) == 0) && floor_ptr->grid_array[y][x].o_idx_list.empty();
}
* Line 1 -- forbid non-drops
* Line 2 -- forbid object terrains
*/
-bool cave_drop_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+bool cave_drop_bold(FloorType *floor_ptr, POSITION y, POSITION x)
{
return cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::DROP) && ((floor_ptr->grid_array[y][x].is_object()) == 0);
}
-bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x)
+bool pattern_tile(FloorType *floor_ptr, POSITION y, POSITION x)
{
return cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::PATTERN);
}
#include "system/angband.h"
-struct floor_type;
+class FloorType;
struct grid_type;
class PlayerType;
enum class TerrainCharacteristics;
-bool in_bounds(floor_type *floor_ptr, POSITION y, POSITION x);
-bool in_bounds2(floor_type *floor_ptr, POSITION y, POSITION x);
-bool in_bounds2u(floor_type *floor_ptr, POSITION y, POSITION x);
+bool in_bounds(FloorType *floor_ptr, POSITION y, POSITION x);
+bool in_bounds2(FloorType *floor_ptr, POSITION y, POSITION x);
+bool in_bounds2u(FloorType *floor_ptr, POSITION y, POSITION x);
bool is_cave_empty_bold(PlayerType *player_ptr, POSITION x, POSITION y);
bool is_cave_empty_bold2(PlayerType *player_ptr, POSITION x, POSITION y);
-bool cave_has_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, TerrainCharacteristics f_idx);
+bool cave_has_flag_bold(FloorType *floor_ptr, POSITION y, POSITION x, TerrainCharacteristics f_idx);
bool player_has_los_bold(PlayerType *player_ptr, POSITION y, POSITION x);
bool player_bold(PlayerType *player_ptr, POSITION y, POSITION x);
-bool cave_stop_disintegration(floor_type *floor_ptr, POSITION y, POSITION x);
-bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+bool cave_stop_disintegration(FloorType *floor_ptr, POSITION y, POSITION x);
+bool cave_los_bold(FloorType *floor_ptr, POSITION y, POSITION x);
bool feat_supports_los(FEAT_IDX f_idx);
-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);
+bool cave_clean_bold(FloorType *floor_ptr, POSITION y, POSITION x);
+bool cave_drop_bold(FloorType *floor_ptr, POSITION y, POSITION x);
+bool pattern_tile(FloorType *floor_ptr, POSITION y, POSITION x);
* @param x 配置先X座標
* @return エラーコード
*/
-static void drop_here(floor_type *floor_ptr, ObjectType *j_ptr, POSITION y, POSITION x)
+static void drop_here(FloorType *floor_ptr, ObjectType *j_ptr, POSITION y, POSITION x)
{
OBJECT_IDX o_idx = o_pop(floor_ptr);
ObjectType *o_ptr;
* while new floor creation since dungeons may be re-created by
* auto-scum option.
*/
-static void update_unique_artifact(floor_type *floor_ptr, int16_t cur_floor_id)
+static void update_unique_artifact(FloorType *floor_ptr, int16_t cur_floor_id)
{
for (int i = 1; i < floor_ptr->m_max; i++) {
const auto &m_ref = floor_ptr->m_list[i];
/*
* Actually erase the entire "lite" array, redrawing every grid
*/
-void forget_lite(floor_type *floor_ptr)
+void forget_lite(FloorType *floor_ptr)
{
if (!floor_ptr->lite_n) {
return;
/*
* Clear the viewable space
*/
-void forget_view(floor_type *floor_ptr)
+void forget_view(FloorType *floor_ptr)
{
if (!floor_ptr->view_n) {
return;
#pragma once
class PlayerType;
-struct floor_type;
+class FloorType;
void day_break(PlayerType *player_ptr);
void night_falls(PlayerType *player_ptr);
void update_dungeon_feeling(PlayerType *player_ptr);
void glow_deep_lava_and_bldg(PlayerType *player_ptr);
-void forget_lite(floor_type *floor_ptr);
-void forget_view(floor_type *floor_ptr);
+void forget_lite(FloorType *floor_ptr);
+void forget_view(FloorType *floor_ptr);
/*!
* @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after grid_array generation
*/
-void wipe_generate_random_floor_flags(floor_type *floor_ptr)
+void wipe_generate_random_floor_flags(FloorType *floor_ptr)
{
for (POSITION y = 0; y < floor_ptr->height; y++) {
for (POSITION x = 0; x < floor_ptr->width; x++) {
floor_ptr->object_level = floor_ptr->base_level;
}
-typedef bool (*IsWallFunc)(const floor_type *, int, int);
+typedef bool (*IsWallFunc)(const FloorType *, int, int);
// (y,x) がプレイヤーが通れない永久地形かどうかを返す。
-static bool is_permanent_blocker(const floor_type *const floor_ptr, const int y, const int x)
+static bool is_permanent_blocker(const FloorType *const floor_ptr, const int y, const int x)
{
const FEAT_IDX feat = floor_ptr->grid_array[y][x].feat;
const auto &flags = terrains_info[feat].flags;
return flags.has(TerrainCharacteristics::PERMANENT) && flags.has_not(TerrainCharacteristics::MOVE);
}
-static void floor_is_connected_dfs(const floor_type *const floor_ptr, const IsWallFunc is_wall, const int y_start, const int x_start, bool *const visited)
+static void floor_is_connected_dfs(const FloorType *const floor_ptr, const IsWallFunc is_wall, const int y_start, const int x_start, bool *const visited)
{
// clang-format off
static const int DY[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
// 各セルの8近傍は互いに移動可能とし、is_wall が真を返すセルのみを壁とみなす。
//
// 連結成分数が 0 の場合、偽を返す。
-static bool floor_is_connected(const floor_type *const floor_ptr, const IsWallFunc is_wall)
+static bool floor_is_connected(const FloorType *const floor_ptr, const IsWallFunc is_wall)
{
static std::array<bool, MAX_HGT * MAX_WID> visited;
#pragma once
-struct floor_type;
+class FloorType;
class PlayerType;
-void wipe_generate_random_floor_flags(floor_type *floor_ptr);
+void wipe_generate_random_floor_flags(FloorType *floor_ptr);
void clear_cave(PlayerType *player_ptr);
void generate_floor(PlayerType *player_ptr);
* @brief 新フロアに移動元フロアに繋がる階段を配置する / Virtually teleport onto the stairs that is connecting between two floors.
* @param sf_ptr 移動元の保存フロア構造体参照ポインタ
*/
-static void locate_connected_stairs(PlayerType *player_ptr, floor_type *floor_ptr, saved_floor_type *sf_ptr, BIT_FLAGS floor_mode)
+static void locate_connected_stairs(PlayerType *player_ptr, FloorType *floor_ptr, saved_floor_type *sf_ptr, BIT_FLAGS floor_mode)
{
POSITION sx = 0;
POSITION sy = 0;
msg_format_wizard(player_ptr, CHEAT_OBJECT, _("%sを生成しました。", "%s was generated."), o_name);
}
-static int get_base_floor(floor_type *floor_ptr, BIT_FLAGS mode, std::optional<int> rq_mon_level)
+static int get_base_floor(FloorType *floor_ptr, BIT_FLAGS mode, std::optional<int> rq_mon_level)
{
if (any_bits(mode, AM_GREAT)) {
if (rq_mon_level.has_value()) {
* @param floo_ptr 現在フロアへの参照ポインタ
* @param o_idx 削除対象のオブジェクト構造体ポインタ
*/
-void excise_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx)
+void excise_object_idx(FloorType *floor_ptr, OBJECT_IDX o_idx)
{
auto &list = get_o_idx_list_contains(floor_ptr, o_idx);
list.remove(o_idx);
* @param o_idx 参照を得るリストに含まれるOBJECT_IDX
* @return o_idxを含む ObjectIndexList への参照
*/
-ObjectIndexList &get_o_idx_list_contains(floor_type *floor_ptr, OBJECT_IDX o_idx)
+ObjectIndexList &get_o_idx_list_contains(FloorType *floor_ptr, OBJECT_IDX o_idx)
{
auto *o_ptr = &floor_ptr->o_list[o_idx];
* @param floo_ptr 現在フロアへの参照ポインタ
* @param item メッセージの対象にしたいアイテム所持スロット
*/
-void floor_item_charges(floor_type *floor_ptr, INVENTORY_IDX item)
+void floor_item_charges(FloorType *floor_ptr, INVENTORY_IDX item)
{
auto *o_ptr = &floor_ptr->o_list[item];
if ((o_ptr->tval != ItemKindType::STAFF) && (o_ptr->tval != ItemKindType::WAND)) {
class ObjectIndexList;
-struct floor_type;
+class FloorType;
class ObjectType;
class PlayerType;
class ItemTester;
void floor_item_increase(PlayerType *player_ptr, INVENTORY_IDX item, ITEM_NUMBER num);
void floor_item_optimize(PlayerType *player_ptr, INVENTORY_IDX item);
void delete_object_idx(PlayerType *player_ptr, OBJECT_IDX o_idx);
-void excise_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx);
-ObjectIndexList &get_o_idx_list_contains(floor_type *floor_ptr, OBJECT_IDX o_idx);
+void excise_object_idx(FloorType *floor_ptr, OBJECT_IDX o_idx);
+ObjectIndexList &get_o_idx_list_contains(FloorType *floor_ptr, OBJECT_IDX o_idx);
OBJECT_IDX drop_near(PlayerType *player_ptr, ObjectType *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
-void floor_item_charges(floor_type *player_ptr, INVENTORY_IDX item);
+void floor_item_charges(FloorType *player_ptr, INVENTORY_IDX item);
void floor_item_describe(PlayerType *player_ptr, INVENTORY_IDX item);
ObjectType *choose_object(PlayerType *player_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, const ItemTester &item_tester = AllMatchItemTester());
* @param feat2 境界部地形ID
* @param width 基本幅
*/
-static void recursive_river(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, FEAT_IDX feat1, FEAT_IDX feat2, POSITION width)
+static void recursive_river(FloorType *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, FEAT_IDX feat1, FEAT_IDX feat2, POSITION width)
{
POSITION dx, dy, length, l, x, y;
POSITION changex, changey;
* @param feat1 中央部地形ID
* @param feat2 境界部地形ID
*/
-void add_river(floor_type *floor_ptr, dun_data_type *dd_ptr)
+void add_river(FloorType *floor_ptr, dun_data_type *dd_ptr)
{
dungeon_type *dungeon_ptr;
POSITION y2, x2;
#include "system/angband.h"
struct dun_data_type;
-struct floor_type;
+class FloorType;
class PlayerType;
-void add_river(floor_type *floor_ptr, dun_data_type *dd_ptr);
+void add_river(FloorType *floor_ptr, dun_data_type *dd_ptr);
void build_streamer(PlayerType *player_ptr, FEAT_IDX feat, int chance);
void place_trees(PlayerType *player_ptr, POSITION x, POSITION y);
void destroy_level(PlayerType *player_ptr);
* Not completely allocated, that would be inefficient
* Not completely hardcoded, that would overflow memory
*/
-floor_type floor_info;
+FloorType floor_info;
static int scent_when = 0;
* Whenever the age count loops, most of the scent trail is erased and
* the age of the remainder is recalculated.
*/
-void update_smell(floor_type *floor_ptr, PlayerType *player_ptr)
+void update_smell(FloorType *floor_ptr, PlayerType *player_ptr)
{
/* Create a table that controls the spread of scent */
const int scent_adjust[5][5] = {
/*
* Hack -- forget the "flow" information
*/
-void forget_flow(floor_type *floor_ptr)
+void forget_flow(FloorType *floor_ptr)
{
for (POSITION y = 0; y < floor_ptr->height; y++) {
for (POSITION x = 0; x < floor_ptr->width; x++) {
* clear those fields for grids/monsters containing objects,
* and we clear it once for every such object.
*/
-void wipe_o_list(floor_type *floor_ptr)
+void wipe_o_list(FloorType *floor_ptr)
{
for (OBJECT_IDX i = 1; i < floor_ptr->o_max; i++) {
auto *o_ptr = &floor_ptr->o_list[i];
#include "system/angband.h"
-struct floor_type;
-extern floor_type floor_info;
+class FloorType;
+extern FloorType floor_info;
class PlayerType;
-void update_smell(floor_type *floor_ptr, PlayerType *player_ptr);
-void forget_flow(floor_type *floor_ptr);
-void wipe_o_list(floor_type *floor_ptr);
+void update_smell(FloorType *floor_ptr, PlayerType *player_ptr);
+void forget_flow(FloorType *floor_ptr);
+void wipe_o_list(FloorType *floor_ptr);
void scatter(PlayerType *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
concptr map_name(PlayerType *player_ptr);
* @note Assumes "in_bounds()"
* @details We count only granite walls and permanent walls.
*/
-static int next_to_walls(floor_type *floor_ptr, POSITION y, POSITION x)
+static int next_to_walls(FloorType *floor_ptr, POSITION y, POSITION x)
{
int k = 0;
if (in_bounds(floor_ptr, y + 1, x) && floor_ptr->grid_array[y + 1][x].is_extra()) {
* @param Y 指定Y座標
* @param X 指定X座標
*/
-static void place_rubble(floor_type *floor_ptr, POSITION y, POSITION x)
+static void place_rubble(FloorType *floor_ptr, POSITION y, POSITION x)
{
set_cave_feat(floor_ptr, y, x, feat_rubble);
}
*/
/*
*/
-static void prepare_label_string_floor(floor_type *floor_ptr, char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
+static void prepare_label_string_floor(FloorType *floor_ptr, char *label, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
{
concptr alphabet_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
strcpy(label, alphabet_chars);
* @param depth_max 深みの最大値
*/
static void perturb_point_mid(
- floor_type *floor_ptr, FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, FEAT_IDX x4, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
+ FloorType *floor_ptr, FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, FEAT_IDX x4, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
{
FEAT_IDX tmp2 = rough * 2 + 1;
FEAT_IDX tmp = randint1(tmp2) - (rough + 1);
* @param rough ランダム幅
* @param depth_max 深みの最大値
*/
-static void perturb_point_end(floor_type *floor_ptr, FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
+static void perturb_point_end(FloorType *floor_ptr, FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
{
FEAT_IDX tmp2 = rough * 2 + 1;
FEAT_IDX tmp = randint0(tmp2) - rough;
* need to be converted to features.
* </pre>
*/
-static void plasma_recursive(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, FEAT_IDX depth_max, FEAT_IDX rough)
+static void plasma_recursive(FloorType *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, FEAT_IDX depth_max, FEAT_IDX rough)
{
POSITION xmid = (x2 - x1) / 2 + x1;
POSITION ymid = (y2 - y1) / 2 + y1;
* @param border 未使用
* @param corner 広域マップの角部分としての生成ならばTRUE
*/
-static void generate_wilderness_area(floor_type *floor_ptr, int terrain, uint32_t seed, bool corner)
+static void generate_wilderness_area(FloorType *floor_ptr, int terrain, uint32_t seed, bool corner)
{
if (terrain == TERRAIN_EDGE) {
for (POSITION y1 = 0; y1 < MAX_HGT; y1++) {
* grids which are not in rooms. We might want to also count stairs,\n
* open doors, closed doors, etc.
*/
-static int next_to_corr(floor_type *floor_ptr, POSITION y1, POSITION x1)
+static int next_to_corr(FloorType *floor_ptr, POSITION y1, POSITION x1)
{
int k = 0;
for (int i = 0; i < 4; i++) {
* @return ドアを設置可能ならばTRUEを返す
* @details まず垂直方向に、次に水平方向に調べる
*/
-static bool possible_doorway(floor_type *floor_ptr, POSITION y, POSITION x)
+static bool possible_doorway(FloorType *floor_ptr, POSITION y, POSITION x)
{
if (next_to_corr(floor_ptr, y, x) < 2) {
return false;
}
}
-FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat)
+FEAT_IDX conv_dungeon_feat(FloorType *floor_ptr, FEAT_IDX newfeat)
{
auto *f_ptr = &terrains_info[newfeat];
if (f_ptr->flags.has_not(TerrainCharacteristics::CONVERT)) {
extern FEAT_IDX feat_ground_type[100];
extern FEAT_IDX feat_wall_type[100];
-struct floor_type;
+class FloorType;
class PlayerType;
class TerrainType;
bool is_closed_door(PlayerType *player_ptr, FEAT_IDX feat);
FEAT_IDX feat_locked_door_random(int door_type);
FEAT_IDX feat_jammed_door_random(int door_type);
void cave_set_feat(PlayerType *player_ptr, POSITION y, POSITION x, FEAT_IDX feat);
-FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat);
+FEAT_IDX conv_dungeon_feat(FloorType *floor_ptr, FEAT_IDX newfeat);
{
POSITION x, y;
DIRECTION d;
- floor_type *f_ptr = player_ptr->current_floor_ptr;
+ FloorType *f_ptr = player_ptr->current_floor_ptr;
/* The last way-point is on the map */
if (player_ptr->running && in_bounds(f_ptr, flow_y, flow_x)) {
* Take a feature, determine what that feature becomes
* through applying the given action.
*/
-FEAT_IDX feat_state(floor_type *floor_ptr, FEAT_IDX feat, TerrainCharacteristics action)
+FEAT_IDX feat_state(FloorType *floor_ptr, FEAT_IDX feat, TerrainCharacteristics action)
{
auto *f_ptr = &terrains_info[feat];
int i;
place_grid(player_ptr, g_ptr, gb_type);
}
-void set_cave_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feature_idx)
+void set_cave_feat(FloorType *floor_ptr, POSITION y, POSITION x, FEAT_IDX feature_idx)
{
floor_ptr->grid_array[y][x].feat = feature_idx;
}
* have already been placed into the "lite" array, and we are never
* called when the "lite" array is full.
*/
-void cave_lite_hack(floor_type *floor_ptr, POSITION y, POSITION x)
+void cave_lite_hack(FloorType *floor_ptr, POSITION y, POSITION x)
{
auto *g_ptr = &floor_ptr->grid_array[y][x];
if (g_ptr->is_lite()) {
/*
* For delayed visual update
*/
-void cave_redraw_later(floor_type *floor_ptr, POSITION y, POSITION x)
+void cave_redraw_later(FloorType *floor_ptr, POSITION y, POSITION x)
{
auto *g_ptr = &floor_ptr->grid_array[y][x];
if (g_ptr->is_redraw()) {
/*
* For delayed visual update
*/
-void cave_note_and_redraw_later(floor_type *floor_ptr, POSITION y, POSITION x)
+void cave_note_and_redraw_later(FloorType *floor_ptr, POSITION y, POSITION x)
{
floor_ptr->grid_array[y][x].info |= CAVE_NOTE;
cave_redraw_later(floor_ptr, y, x);
}
-void cave_view_hack(floor_type *floor_ptr, POSITION y, POSITION x)
+void cave_view_hack(FloorType *floor_ptr, POSITION y, POSITION x)
{
auto *g_ptr = &floor_ptr->grid_array[y][x];
if (g_ptr->is_view()) {
GB_SOLID_NOPERM
};
-struct floor_type;
+class FloorType;
struct grid_type;
class PlayerType;
struct monster_race;
void note_spot(PlayerType *player_ptr, POSITION y, POSITION x);
void lite_spot(PlayerType *player_ptr, POSITION y, POSITION x);
void update_flow(PlayerType *player_ptr);
-FEAT_IDX feat_state(floor_type *floor_ptr, FEAT_IDX feat, TerrainCharacteristics action);
+FEAT_IDX feat_state(FloorType *floor_ptr, FEAT_IDX feat, TerrainCharacteristics action);
void cave_alter_feat(PlayerType *player_ptr, POSITION y, POSITION x, TerrainCharacteristics action);
bool is_open(PlayerType *player_ptr, FEAT_IDX feat);
bool check_local_illumination(PlayerType *player_ptr, POSITION y, POSITION x);
bool darkened_grid(PlayerType *player_ptr, grid_type *g_ptr);
void delete_monster(PlayerType *player_ptr, POSITION y, POSITION x);
void place_bold(PlayerType *player_ptr, POSITION y, POSITION x, grid_bold_type gh_type);
-void set_cave_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feature_idx);
+void set_cave_feat(FloorType *floor_ptr, POSITION y, POSITION x, FEAT_IDX feature_idx);
int count_dt(PlayerType *player_ptr, POSITION *y, POSITION *x, bool (*test)(PlayerType *, FEAT_IDX), bool under);
-void cave_lite_hack(floor_type *floor_ptr, POSITION y, POSITION x);
-void cave_redraw_later(floor_type *floor_ptr, POSITION y, POSITION x);
-void cave_note_and_redraw_later(floor_type *floor_ptr, POSITION y, POSITION x);
-void cave_view_hack(floor_type *floor_ptr, POSITION y, POSITION x);
+void cave_lite_hack(FloorType *floor_ptr, POSITION y, POSITION x);
+void cave_redraw_later(FloorType *floor_ptr, POSITION y, POSITION x);
+void cave_note_and_redraw_later(FloorType *floor_ptr, POSITION y, POSITION x);
+void cave_view_hack(FloorType *floor_ptr, POSITION y, POSITION x);
* @details
* 条件は永久地形でなく、なおかつ該当のマスにアーティファクトが存在しないか、である。英語の旧コメントに反して*破壊*の抑止判定には現在使われていない。
*/
-bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+bool cave_valid_bold(FloorType *floor_ptr, POSITION y, POSITION x)
{
auto *g_ptr = &floor_ptr->grid_array[y][x];
if (g_ptr->cave_has_flag(TerrainCharacteristics::PERMANENT)) {
#include "system/angband.h"
-struct floor_type;
+class FloorType;
class PlayerType;
void place_random_stairs(PlayerType *player_ptr, POSITION y, POSITION x);
-bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+bool cave_valid_bold(FloorType *floor_ptr, POSITION y, POSITION x);
* @param buf 解析文字列
* @return エラーコード
*/
-parse_error_type parse_line_feature(floor_type *floor_ptr, char *buf)
+parse_error_type parse_line_feature(FloorType *floor_ptr, char *buf)
{
if (init_flags & INIT_ONLY_BUILDINGS) {
return PARSE_ERROR_NONE;
extern dungeon_grid letter[255];
struct angband_header;
-struct floor_type;
+class FloorType;
using Parser = std::function<errr(std::string_view, angband_header *)>;
errr init_info_txt(FILE *fp, char *buf, angband_header *head, Parser parse_info_txt_line);
-parse_error_type parse_line_feature(floor_type *floor_ptr, char *buf);
+parse_error_type parse_line_feature(FloorType *floor_ptr, char *buf);
parse_error_type parse_line_building(char *buf);
* Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
* and "x" is the "current" command_cmd code.\n
*/
-bool get_tag_floor(floor_type *floor_ptr, COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
+bool get_tag_floor(FloorType *floor_ptr, COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num)
{
for (COMMAND_CODE i = 0; i < floor_num && i < 23; i++) {
auto *o_ptr = &floor_ptr->o_list[floor_list[i]];
#include "object/tval-types.h"
#include "system/angband.h"
-struct floor_type;
+class FloorType;
class PlayerType;
class ItemTester;
bool is_ring_slot(int i);
-bool get_tag_floor(floor_type *floor_ptr, COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num);
+bool get_tag_floor(FloorType *floor_ptr, COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], ITEM_NUMBER floor_num);
bool get_tag(PlayerType *player_ptr, COMMAND_CODE *cp, char tag, BIT_FLAGS mode, const ItemTester &item_tester);
bool get_item_okay(PlayerType *player_ptr, OBJECT_IDX i, const ItemTester &item_tester);
bool get_item_allow(PlayerType *player_ptr, INVENTORY_IDX item);
* @param x 指定のx座標
* @return 暗いならTRUE、そうでないならFALSE
*/
-static bool is_target_grid_dark(floor_type *f_ptr, POSITION y, POSITION x)
+static bool is_target_grid_dark(FloorType *f_ptr, POSITION y, POSITION x)
{
if (any_bits(f_ptr->grid_array[y][x].info, CAVE_MNLT)) {
return false;
{
POSITION y = player_ptr->y;
POSITION x = player_ptr->x;
- floor_type *f_ptr;
+ FloorType *f_ptr;
for (int i = 0; i < 3; i++) {
if (!tgt_pt(player_ptr, &x, &y)) {
* @brief 現在フロアに存在している鏡の数を数える / calculate mirrors
* @return 鏡の枚数
*/
-static int number_of_mirrors(floor_type *floor_ptr)
+static int number_of_mirrors(FloorType *floor_ptr)
{
int val = 0;
for (POSITION x = 0; x < floor_ptr->width; x++) {
* @brief 画面切り替え等でモンスターの灯りを消去する
* @param floor_ptr 現在フロアへの参照ポインタ
*/
-void clear_mon_lite(floor_type *floor_ptr)
+void clear_mon_lite(FloorType *floor_ptr)
{
for (int i = 0; i < floor_ptr->mon_lite_n; i++) {
grid_type *g_ptr;
#pragma once
-struct floor_type;
+class FloorType;
class PlayerType;
void update_mon_lite(PlayerType *player_ptr);
-void clear_mon_lite(floor_type *floor_ptr);
+void clear_mon_lite(FloorType *floor_ptr);
* @details
* This routine should almost never fail, but it *can* happen.
*/
-MONSTER_IDX m_pop(floor_type *floor_ptr)
+MONSTER_IDX m_pop(FloorType *floor_ptr)
{
/* Normal allocation */
if (floor_ptr->m_max < w_ptr->max_m_idx) {
* @param r_ptr モンスター種族の参照ポインタ
* @return 加速値
*/
-byte get_mspeed(floor_type *floor_ptr, monster_race *r_ptr)
+byte get_mspeed(FloorType *floor_ptr, monster_race *r_ptr)
{
auto mspeed = r_ptr->speed;
if (r_ptr->kind_flags.has_not(MonsterKindType::UNIQUE) && !floor_ptr->inside_arena) {
* @param m_idx 隣接数を調べたいモンスターのID
* @return 隣接しているモンスターの数
*/
-int get_monster_crowd_number(floor_type *floor_ptr, MONSTER_IDX m_idx)
+int get_monster_crowd_number(FloorType *floor_ptr, MONSTER_IDX m_idx)
{
auto *m_ptr = &floor_ptr->m_list[m_idx];
POSITION my = m_ptr->fy;
#define GMN_ARENA 0x00000001 //!< 賭け闘技場向け生成
enum class MonsterRaceId : int16_t;
-struct floor_type;
+class FloorType;
struct monster_race;
class PlayerType;
-MONSTER_IDX m_pop(floor_type *floor_ptr);
+MONSTER_IDX m_pop(FloorType *floor_ptr);
MonsterRaceId get_mon_num(PlayerType *player_ptr, DEPTH min_level, DEPTH max_level, BIT_FLAGS option);
void choose_new_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool born, MonsterRaceId r_idx);
-byte get_mspeed(floor_type *player_ptr, monster_race *r_ptr);
-int get_monster_crowd_number(floor_type *floor_ptr, MONSTER_IDX m_idx);
+byte get_mspeed(FloorType *player_ptr, monster_race *r_ptr);
+int get_monster_crowd_number(FloorType *floor_ptr, MONSTER_IDX m_idx);
* @return m_idx モンスターの参照ID
* @return mproc_type 削除したいモンスターの時限ステータスID
*/
-static void mproc_remove(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
+static void mproc_remove(FloorType *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
{
int mproc_idx = get_mproc_idx(floor_ptr, m_idx, mproc_type);
if (mproc_idx >= 0) {
* @param m_idx モンスターID
* @return POWERFULフラグがあればTRUE、なければFALSEを返す。
*/
-bool monster_is_powerful(floor_type *floor_ptr, MONSTER_IDX m_idx)
+bool monster_is_powerful(FloorType *floor_ptr, MONSTER_IDX m_idx)
{
auto *m_ptr = &floor_ptr->m_list[m_idx];
auto *r_ptr = &monraces_info[m_ptr->r_idx];
* @param m_idx モンスターID
* @return モンスターのレベル
*/
-DEPTH monster_level_idx(floor_type *floor_ptr, MONSTER_IDX m_idx)
+DEPTH monster_level_idx(FloorType *floor_ptr, MONSTER_IDX m_idx)
{
auto *m_ptr = &floor_ptr->m_list[m_idx];
auto *r_ptr = &monraces_info[m_ptr->r_idx];
* @return mproc_type モンスターの時限ステータスID
* @return 残りターン値
*/
-int get_mproc_idx(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
+int get_mproc_idx(FloorType *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
{
const auto &cur_mproc_list = floor_ptr->mproc_list[mproc_type];
for (int i = floor_ptr->mproc_max[mproc_type] - 1; i >= 0; i--) {
* @return m_idx モンスターの参照ID
* @return mproc_type 追加したいモンスターの時限ステータスID
*/
-void mproc_add(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
+void mproc_add(FloorType *floor_ptr, MONSTER_IDX m_idx, int mproc_type)
{
if (floor_ptr->mproc_max[mproc_type] < w_ptr->max_m_idx) {
floor_ptr->mproc_list[mproc_type][floor_ptr->mproc_max[mproc_type]++] = (int16_t)m_idx;
* @brief モンスターの時限ステータスリストを初期化する / Initialize monster process
* @param floor_ptr 現在フロアへの参照ポインタ
*/
-void mproc_init(floor_type *floor_ptr)
+void mproc_init(FloorType *floor_ptr)
{
/* Reset "player_ptr->current_floor_ptr->mproc_max[]" */
for (int i = 0; i < MAX_MTIMED; i++) {
#include "system/angband.h"
enum class MonsterRaceId : int16_t;
-struct floor_type;
+class FloorType;
class PlayerType;
struct monster_type;
-bool monster_is_powerful(floor_type *floor_ptr, MONSTER_IDX m_idx);
-DEPTH monster_level_idx(floor_type *floor_ptr, MONSTER_IDX m_idx);
+bool monster_is_powerful(FloorType *floor_ptr, MONSTER_IDX m_idx);
+DEPTH monster_level_idx(FloorType *floor_ptr, MONSTER_IDX m_idx);
int mon_damage_mod(PlayerType *player_ptr, monster_type *m_ptr, int dam, bool is_psy_spear);
void process_monsters_mtimed(PlayerType *player_ptr, int mtimed_idx);
-int get_mproc_idx(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type);
-void mproc_init(floor_type *floor_ptr);
-void mproc_add(floor_type *floor_ptr, MONSTER_IDX m_idx, int mproc_type);
+int get_mproc_idx(FloorType *floor_ptr, MONSTER_IDX m_idx, int mproc_type);
+void mproc_init(FloorType *floor_ptr);
+void mproc_add(FloorType *floor_ptr, MONSTER_IDX m_idx, int mproc_type);
*/
static errr do_get_mon_num_prep(PlayerType *player_ptr, const monsterrace_hook_type hook1, const monsterrace_hook_type hook2, const bool restrict_to_dungeon)
{
- const floor_type *const floor_ptr = player_ptr->current_floor_ptr;
+ const FloorType *const floor_ptr = player_ptr->current_floor_ptr;
// デバッグ用統計情報。
int mon_num = 0; // 重み(prob2)が正の要素数
msa_ptr->x_br_lite = 0;
}
-static void feature_projection(floor_type *floor_ptr, msa_type *msa_ptr)
+static void feature_projection(FloorType *floor_ptr, msa_type *msa_ptr)
{
auto *f_ptr = &terrains_info[floor_ptr->grid_array[msa_ptr->y][msa_ptr->x].feat];
if (f_ptr->flags.has(TerrainCharacteristics::PROJECT)) {
* @param m_idx モンスターID
* @return 召喚可能であればPM_ALLOW_UNIQUEを返す。
*/
-static BIT_FLAGS monster_u_mode(floor_type *floor_ptr, MONSTER_IDX m_idx)
+static BIT_FLAGS monster_u_mode(FloorType *floor_ptr, MONSTER_IDX m_idx)
{
BIT_FLAGS u_mode = 0L;
auto *m_ptr = &floor_ptr->m_list[m_idx];
* @param t_idx モンスターID二体目
* @return モンスター2体のどちらかがプレイヤーの近くに居ればTRUE、どちらも遠ければFALSEを返す。
*/
-bool monster_near_player(floor_type *floor_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
+bool monster_near_player(FloorType *floor_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
monster_type *m_ptr = &floor_ptr->m_list[m_idx];
monster_type *t_ptr = &floor_ptr->m_list[t_idx];
bool monspell_message_base(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg &msgs, bool msg_flag_aux, int target_type)
{
bool notice = false;
- floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ FloorType *floor_ptr = player_ptr->current_floor_ptr;
bool known = monster_near_player(floor_ptr, m_idx, t_idx);
bool see_either = see_monster(player_ptr, m_idx) || see_monster(player_ptr, t_idx);
bool mon_to_mon = (target_type == MONSTER_TO_MONSTER);
#define RF5_SPELL_START 32 * 4
#define RF6_SPELL_START 32 * 5
-struct floor_type;
+class FloorType;
class PlayerType;
struct mspell_cast_msg {
};
bool see_monster(PlayerType *player_ptr, MONSTER_IDX m_idx);
-bool monster_near_player(floor_type *floor_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
+bool monster_near_player(FloorType *floor_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx);
bool monspell_message_base(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg &msgs, bool msg_flag_aux, int target_type);
bool monspell_message(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_blind &msgs, int target_type);
void simple_monspell_message(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_simple &msgs, int target_type);
#include <algorithm>
-void ObjectIndexList::add(floor_type *floor_ptr, OBJECT_IDX o_idx, IDX stack_idx)
+void ObjectIndexList::add(FloorType *floor_ptr, OBJECT_IDX o_idx, IDX stack_idx)
{
if (stack_idx <= 0) {
stack_idx = o_idx_list_.empty() ? 1 : floor_ptr->o_list[o_idx_list_.front()].stack_idx + 1;
o_idx_list_.remove(o_idx);
}
-void ObjectIndexList::rotate(floor_type *floor_ptr)
+void ObjectIndexList::rotate(FloorType *floor_ptr)
{
if (o_idx_list_.size() < 2) {
return;
#include <list>
-struct floor_type;
+class FloorType;
/**
* @brief アイテムリスト(床上スタック/モンスター所持)を管理するクラス
* @param o_idx 追加するアイテムのフロア全体のアイテム配列上の要素番号
* @param stack_idx アイテムリストに追加する位置(デフォルト:0)
*/
- void add(floor_type *floor_ptr, OBJECT_IDX o_idx, IDX stack_idx = 0);
+ void add(FloorType *floor_ptr, OBJECT_IDX o_idx, IDX stack_idx = 0);
/**
* @brief アイテムリストからフロア全体のアイテム配列上の指定した要素番号のアイテムを削除する
* 先頭のアイテムを最後尾に移動した後各アイテムの stack_idx は1ずつインクリメントされ、
* 最後尾に移動したアイテムの stack_idx は 1 になる。
*/
- void rotate(floor_type *floor_ptr);
+ void rotate(FloorType *floor_ptr);
//
// 以下のメソッドは内部で保持している std::list オブジェクトに対して使用できる同名のメソッド
* Store routine for the fractal floor generator
* this routine probably should be an inline function or a macro.
*/
-static void store_height(floor_type *floor_ptr, POSITION x, POSITION y, FEAT_IDX val)
+static void store_height(FloorType *floor_ptr, POSITION x, POSITION y, FEAT_IDX val)
{
if (((x == fill_data.xmin) || (y == fill_data.ymin) || (x == fill_data.xmax) || (y == fill_data.ymax)) && (val <= fill_data.c1)) {
val = fill_data.c1 + 1;
return;
}
-void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
+void generate_hmap(FloorType *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
{
POSITION xsize = xsiz;
POSITION ysize = ysiz;
#include "system/angband.h"
-struct floor_type;
+class FloorType;
class PlayerType;
-void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff);
+void generate_hmap(FloorType *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff);
bool generate_fracave(PlayerType *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room);
bool generate_lake(PlayerType *player_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type);
* @param allow_flag_mask 生成が許されるpit/nestのビット配列
* @return 選択されたpit/nestのID、選択失敗した場合-1を返す。
*/
-static int pick_vault_type(floor_type *floor_ptr, std::vector<nest_pit_type> &l_ptr, BIT_FLAGS16 allow_flag_mask)
+static int pick_vault_type(FloorType *floor_ptr, std::vector<nest_pit_type> &l_ptr, BIT_FLAGS16 allow_flag_mask)
{
ProbabilityTable<int> table;
for (size_t i = 0; i < l_ptr.size(); i++) {
* @param y チェックするマスのY座標
* @return 床系地形ならばTRUE
*/
-static bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y)
+static bool get_is_floor(FloorType *floor_ptr, POSITION x, POSITION y)
{
if (!in_bounds(floor_ptr, y, x)) {
return false;
std::vector<Pos2D> points;
POSITION p = player_ptr->cur_lite;
- floor_type *const floor_ptr = player_ptr->current_floor_ptr;
+ FloorType *const floor_ptr = player_ptr->current_floor_ptr;
// 前回照らされていた座標たちを記録。
for (int i = 0; i < floor_ptr->lite_n; i++) {
#include "world/world.h"
#include <vector>
-using PassBoldFunc = bool (*)(floor_type *, POSITION, POSITION);
+using PassBoldFunc = bool (*)(FloorType *, POSITION, POSITION);
/*!
* @brief 指定した座標全てを照らす。
* @param pass_bold 地形条件を返す関数ポインタ
* @return 該当地形の数
*/
-static int next_to_open(floor_type *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
+static int next_to_open(FloorType *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
{
int len = 0;
int blen = 0;
* @param pass_bold 地形条件を返す関数ポインタ
* @return 該当地形の数
*/
-static int next_to_walls_adj(floor_type *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
+static int next_to_walls_adj(FloorType *floor_ptr, const POSITION cy, const POSITION cx, const PassBoldFunc pass_bold)
{
POSITION y, x;
int c = 0;
* @param x 指定X座標
* @return 射線を通すならばtrueを返す。
*/
-static bool cave_pass_dark_bold(floor_type *floor_ptr, POSITION y, POSITION x)
+static bool cave_pass_dark_bold(FloorType *floor_ptr, POSITION y, POSITION x)
{
return cave_has_flag_bold(floor_ptr, y, x, TerrainCharacteristics::PROJECT);
}
* Modified version of los() for calculation of disintegration balls.
* Disintegration effects are stopped by permanent walls.
*/
-bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
+bool in_disintegration_range(FloorType *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
{
POSITION delta_y = y2 - y1;
POSITION delta_x = x2 - x1;
#include "effect/attribute-types.h"
#include "system/angband.h"
-struct floor_type;
+class FloorType;
class PlayerType;
class projection_path;
-bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
+bool in_disintegration_range(FloorType *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
void breath_shape(PlayerType *player_ptr, const projection_path &path, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, AttributeType typ);
POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
#include "system/floor-type-definition.h"
-bool floor_type::is_in_dungeon() const
+bool FloorType::is_in_dungeon() const
{
return this->dun_level > 0;
}
#include "floor/sight-definitions.h"
#include "monster/monster-timed-effect-types.h"
#include "system/angband.h"
-
#include <vector>
struct grid_type;
-;
-class ObjectType;
struct monster_type;
-struct floor_type {
- DUNGEON_IDX dungeon_idx;
+class ObjectType;
+class FloorType {
+public:
+ FloorType() = default;
+ DUNGEON_IDX dungeon_idx = 0;
std::vector<std::vector<grid_type>> grid_array;
- DEPTH dun_level; /*!< 現在の実ダンジョン階層 base_level の参照元となる / Current dungeon level */
- DEPTH base_level; /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
- DEPTH object_level; /*!< アイテムの生成レベル、 base_level を起点に一時変更する時に参照 / Current object creation level */
- DEPTH monster_level; /*!< モンスターの生成レベル、 base_level を起点に一時変更する時に参照 / Current monster creation level */
- POSITION width; /*!< Current dungeon width */
- POSITION height; /*!< Current dungeon height */
- MONSTER_NUMBER num_repro; /*!< Current reproducer count */
+ DEPTH dun_level = 0; /*!< 現在の実ダンジョン階層 base_level の参照元となる / Current dungeon level */
+ DEPTH base_level = 0; /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
+ DEPTH object_level = 0; /*!< アイテムの生成レベル、 base_level を起点に一時変更する時に参照 / Current object creation level */
+ DEPTH monster_level = 0; /*!< モンスターの生成レベル、 base_level を起点に一時変更する時に参照 / Current monster creation level */
+ POSITION width = 0; /*!< Current dungeon width */
+ POSITION height = 0; /*!< Current dungeon height */
+ MONSTER_NUMBER num_repro = 0; /*!< Current reproducer count */
- GAME_TURN generated_turn; /* Turn when level began */
+ GAME_TURN generated_turn = 0; /* Turn when level began */
std::vector<ObjectType> o_list; /*!< The array of dungeon items [max_o_idx] */
- OBJECT_IDX o_max; /* Number of allocated objects */
- OBJECT_IDX o_cnt; /* Number of live objects */
+ OBJECT_IDX o_max = 0; /* Number of allocated objects */
+ OBJECT_IDX o_cnt = 0; /* Number of live objects */
std::vector<monster_type> m_list; /*!< The array of dungeon monsters [max_m_idx] */
- MONSTER_IDX m_max; /* Number of allocated monsters */
- MONSTER_IDX m_cnt; /* Number of live monsters */
+ MONSTER_IDX m_max = 0; /* Number of allocated monsters */
+ MONSTER_IDX m_cnt = 0; /* Number of live monsters */
- std::vector<int16_t> mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
- int16_t mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
+ std::vector<int16_t> mproc_list[MAX_MTIMED]{}; /*!< The array to process dungeon monsters[max_m_idx] */
+ int16_t mproc_max[MAX_MTIMED]{}; /*!< Number of monsters to be processed */
- POSITION_IDX lite_n; //!< Array of grids lit by player lite
- POSITION lite_y[LITE_MAX];
- POSITION lite_x[LITE_MAX];
+ POSITION_IDX lite_n = 0; //!< Array of grids lit by player lite
+ POSITION lite_y[LITE_MAX]{};
+ POSITION lite_x[LITE_MAX]{};
- POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite
- POSITION mon_lite_y[MON_LITE_MAX];
- POSITION mon_lite_x[MON_LITE_MAX];
+ POSITION_IDX mon_lite_n = 0; //!< Array of grids lit by player lite
+ POSITION mon_lite_y[MON_LITE_MAX]{};
+ POSITION mon_lite_x[MON_LITE_MAX]{};
- POSITION_IDX view_n; //!< Array of grids viewable to the player
- POSITION view_y[VIEW_MAX];
- POSITION view_x[VIEW_MAX];
+ POSITION_IDX view_n = 0; //!< Array of grids viewable to the player
+ POSITION view_y[VIEW_MAX]{};
+ POSITION view_x[VIEW_MAX]{};
- POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating
- POSITION redraw_y[REDRAW_MAX];
- POSITION redraw_x[REDRAW_MAX];
+ POSITION_IDX redraw_n = 0; //!< Array of grids for delayed visual updating
+ POSITION redraw_y[REDRAW_MAX]{};
+ POSITION redraw_x[REDRAW_MAX]{};
- bool monster_noise;
- QuestId quest_number; /* Inside quest level */
- bool inside_arena; /* Is character inside on_defeat_arena_monster? */
+ bool monster_noise = false;
+ QuestId quest_number = QuestId::NONE; /* Inside quest level */
+ bool inside_arena = false; /* Is character inside on_defeat_arena_monster? */
bool is_in_dungeon() const;
};
constexpr int MONSTER_MAXHP = 30000; //!< モンスターの最大HP
enum class MonsterRaceId : int16_t;
-struct floor_type;
+class FloorType;
struct monster_race;
struct monster_type {
MonsterRaceId r_idx{}; /*!< モンスターの実種族ID (これが0の時は死亡扱いになる) / Monster race index 0 = dead. */
MonsterRaceId ap_r_idx{}; /*!< モンスターの外見種族ID(あやしい影、たぬき、ジュラル星人誤認などにより変化する)Monster race appearance index */
- floor_type *current_floor_ptr{}; /*!< 所在フロアID(現状はfloor_type構造体によるオブジェクトは1つしかないためソースコード設計上の意義以外はない)*/
+ FloorType *current_floor_ptr{}; /*!< 所在フロアID(現状はFloorType構造体によるオブジェクトは1つしかないためソースコード設計上の意義以外はない)*/
/* Sub-alignment flags for neutral monsters */
#define SUB_ALIGN_NEUTRAL 0x0000 /*!< モンスターのサブアライメント:中立 */
enum class MonsterAbilityType;
enum class MonsterRaceId : int16_t;
-struct floor_type;
+class FloorType;
class ObjectType;
class TimedEffects;
class PlayerType {
int player_euid{};
int player_egid{};
- floor_type *current_floor_ptr{};
+ FloorType *current_floor_ptr{};
POSITION oldpy{}; /* Previous player location -KMW- */
POSITION oldpx{}; /* Previous player location -KMW- */
* 周り全てが壁に囲まれている壁についてはオプション状態による。
* 1か所でも空きがあるか、壁ではない地形、金を含む地形、永久岩は表示。
*/
-static bool is_revealed_wall(floor_type *floor_ptr, TerrainType *f_ptr, POSITION y, POSITION x)
+static bool is_revealed_wall(FloorType *floor_ptr, TerrainType *f_ptr, POSITION y, POSITION x)
{
if (view_hidden_walls) {
if (view_unsafe_walls) {
* @param y 表示行
* @param max_lines 最大何行描画するか
*/
-void print_monster_list(floor_type *floor_ptr, const std::vector<MONSTER_IDX> &monster_list, TERM_LEN x, TERM_LEN y, TERM_LEN max_lines)
+void print_monster_list(FloorType *floor_ptr, const std::vector<MONSTER_IDX> &monster_list, TERM_LEN x, TERM_LEN y, TERM_LEN max_lines)
{
TERM_LEN line = y;
monster_type *last_mons = nullptr;
* @details
* Lookコマンドでカーソルを合わせた場合に合わせてミミックは考慮しない。
*/
-static const monster_type *monster_on_floor_items(floor_type *floor_ptr, const grid_type *g_ptr)
+static const monster_type *monster_on_floor_items(FloorType *floor_ptr, const grid_type *g_ptr)
{
if (g_ptr->m_idx == 0) {
return nullptr;
#include <vector>
-struct floor_type;
+class FloorType;
class PlayerType;
class ItemTester;
void fix_inventory(PlayerType *player_ptr);
-void print_monster_list(floor_type *floor_ptr, const std::vector<MONSTER_IDX> &monster_list, TERM_LEN x, TERM_LEN y, TERM_LEN max_lines);
+void print_monster_list(FloorType *floor_ptr, const std::vector<MONSTER_IDX> &monster_list, TERM_LEN x, TERM_LEN y, TERM_LEN max_lines);
void fix_monster_list(PlayerType *player_ptr);
void fix_equip(PlayerType *player_ptr);
void fix_player(PlayerType *player_ptr);
enum class MonsterRaceId : int16_t;
-struct floor_type;
+class FloorType;
class PlayerType;
typedef union spell_functions {
struct debug_spell_type1 {
- bool (*spell_function)(PlayerType *, floor_type *);
+ bool (*spell_function)(PlayerType *, FloorType *);
} spell1;
struct debug_spell_type2 {
* This routine should almost never fail, but in case it does,
* we must be sure to handle "failure" of this routine.
*/
-OBJECT_IDX o_pop(floor_type *floor_ptr)
+OBJECT_IDX o_pop(FloorType *floor_ptr)
{
if (floor_ptr->o_max < w_ptr->max_o_idx) {
OBJECT_IDX i = floor_ptr->o_max;
#include "system/angband.h"
-struct floor_type;
+class FloorType;
class PlayerType;
-OBJECT_IDX o_pop(floor_type *floor_ptr);
+OBJECT_IDX o_pop(FloorType *floor_ptr);
OBJECT_IDX get_obj_num(PlayerType *player_ptr, DEPTH level, BIT_FLAGS mode);