OSDN Git Service

[Refactor] #1370 Made parameters private in ObjectThrowEntity
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Fri, 20 Aug 2021 01:29:34 +0000 (10:29 +0900)
committerHourier <grapefox.whitelucifer.0408@gmail.com>
Fri, 20 Aug 2021 01:29:34 +0000 (10:29 +0900)
src/action/throw-util.cpp
src/action/throw-util.h

index e8a9d54..f2419dc 100644 (file)
 
 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)
 {
 }
 
index 772228f..ce9e084 100644 (file)
@@ -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();