From: Hourier Date: Fri, 20 Aug 2021 01:29:34 +0000 (+0900) Subject: [Refactor] #1370 Made parameters private in ObjectThrowEntity X-Git-Tag: vmacos3.0.0-alpha52~124^2^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=eb4d5da1ab685c4c1b03e6ef4f22be385d5f5435;p=hengbandforosx%2Fhengbandosx.git [Refactor] #1370 Made parameters private in ObjectThrowEntity --- diff --git a/src/action/throw-util.cpp b/src/action/throw-util.cpp index e8a9d5476..f2419dcf1 100644 --- a/src/action/throw-util.cpp +++ b/src/action/throw-util.cpp @@ -68,11 +68,11 @@ ObjectThrowEntity::ObjectThrowEntity(player_type *creature_ptr, object_type *q_ptr, const int delay_factor_val, const int mult, const bool boomerang, const OBJECT_IDX shuriken) : q_ptr(q_ptr) + , creature_ptr(creature_ptr) + , shuriken(shuriken) , mult(mult) , msec(delay_factor_val * delay_factor_val * delay_factor_val) , boomerang(boomerang) - , shuriken(shuriken) - , creature_ptr(creature_ptr) { } diff --git a/src/action/throw-util.h b/src/action/throw-util.h index 772228f08..ce9e084a4 100644 --- a/src/action/throw-util.h +++ b/src/action/throw-util.h @@ -14,20 +14,41 @@ struct player_type; class ObjectThrowEntity { public: ObjectThrowEntity() = default; - ObjectThrowEntity(player_type *creature_ptr, object_type *q_ptr, const int delay_factor_val, const int mult, const bool boomerang, const OBJECT_IDX shuriken); + ObjectThrowEntity( + player_type *creature_ptr, object_type *q_ptr, const int delay_factor_val, const int mult, const bool boomerang, const OBJECT_IDX shuriken); virtual ~ObjectThrowEntity() = default; + object_type *q_ptr; - int mult; - int msec; - bool boomerang; - OBJECT_IDX shuriken; OBJECT_IDX item{}; POSITION y{}; POSITION x{}; - POSITION ty{}; - POSITION tx{}; POSITION prev_y{}; POSITION prev_x{}; + bool equiped_item = false; + bool hit_body = false; + PERCENTAGE corruption_possibility{}; + + bool check_can_throw(); + void calc_throw_range(); + bool calc_throw_grid(); + void reflect_inventory_by_throw(); + void set_class_specific_throw_params(); + void set_racial_chance(); + void exe_throw(); + void display_figurine_throw(); + void display_potion_throw(); + void check_boomerang_throw(); + void process_boomerang_back(); + void drop_thrown_item(); + +private: + player_type *creature_ptr; + OBJECT_IDX shuriken; + int mult; + int msec; + bool boomerang; + POSITION ty{}; + POSITION tx{}; POSITION ny[19]{}; POSITION nx[19]{}; int chance{}; @@ -35,11 +56,8 @@ public: int tdis{}; int cur_dis{}; int visible{}; - PERCENTAGE corruption_possibility{}; object_type *o_ptr{}; - bool hit_body = false; bool hit_wall = false; - bool equiped_item = false; bool return_when_thrown = false; GAME_TEXT o_name[MAX_NLEN]{}; BIT_FLAGS obj_flags[TR_FLAG_SIZE]{}; @@ -52,22 +70,6 @@ public: char o2_name[MAX_NLEN]{}; bool super_boomerang{}; - bool check_can_throw(); - void calc_throw_range(); - bool calc_throw_grid(); - void reflect_inventory_by_throw(); - void set_class_specific_throw_params(); - void set_racial_chance(); - void exe_throw(); - void display_figurine_throw(); - void display_potion_throw(); - void check_boomerang_throw(); - void process_boomerang_back(); - void drop_thrown_item(); - -private: - player_type *creature_ptr; - bool check_what_throw(); bool check_throw_boomerang(concptr *q, concptr *s); bool check_racial_target_bold();