OSDN Git Service

[Refactor] #1366 Removed type aliases 'BACT_IDX' and 'BACT_RESTRICT_IDX'
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Thu, 19 Aug 2021 04:57:56 +0000 (13:57 +0900)
committerHourier <grapefox.whitelucifer.0408@gmail.com>
Thu, 19 Aug 2021 11:54:42 +0000 (20:54 +0900)
src/cmd-building/cmd-building.cpp
src/info-reader/general-parser.cpp
src/system/building-type-definition.h
src/system/h-type.h

index 62af68f..92af608 100644 (file)
@@ -110,7 +110,7 @@ static void bldg_process_command(player_type *player_ptr, building_type *bldg, i
         return;
     }
 
-    BACT_IDX bact = bldg->actions[i];
+    auto bact = bldg->actions[i];
     if ((bact != BACT_RECHARGE)
         && (((bldg->member_costs[i] > player_ptr->au) && is_owner(player_ptr, bldg))
             || ((bldg->other_costs[i] > player_ptr->au) && !is_owner(player_ptr, bldg)))) {
index 07480f7..2b288ed 100644 (file)
@@ -222,8 +222,8 @@ parse_error_type parse_line_building(char *buf)
             building[index].member_costs[action_index] = (PRICE)atoi(zz[2]);
             building[index].other_costs[action_index] = (PRICE)atoi(zz[3]);
             building[index].letters[action_index] = zz[4][0];
-            building[index].actions[action_index] = (BACT_IDX)atoi(zz[5]);
-            building[index].action_restr[action_index] = (BACT_RESTRICT_IDX)atoi(zz[6]);
+            building[index].actions[action_index] = static_cast<int16_t>(atoi(zz[5]));
+            building[index].action_restr[action_index] = static_cast<int16_t>(atoi(zz[6]));
             break;
         }
 
index b84b38e..711e1fa 100644 (file)
@@ -27,8 +27,8 @@ typedef struct building_type {
     PRICE member_costs[8]; /* Costs for class members of building */
     PRICE other_costs[8]; /* Costs for nonguild members */
     char letters[8]; /* action letters */
-    BACT_IDX actions[8]; /* action codes */
-    BACT_RESTRICT_IDX action_restr[8]; /* action restrictions */
+    int16_t actions[8]; /*!< 町の施設処理における行動ID */
+    int16_t action_restr[8]; /*!< 町の施設処理の規制処理ID */
 
     player_class_type member_class[MAX_CLASS]; /* which classes are part of guild */
     player_race_type member_race[MAX_RACES]; /* which classes are part of guild */
index 9b78845..cc22dcd 100644 (file)
@@ -78,9 +78,6 @@ typedef int16_t IDX; /*!< ゲーム中のID型を定義 */
 typedef int16_t FEAT_IDX; /*!< ゲーム中の地形ID型を定義 */
 typedef int16_t FLOOR_IDX; /*!< ゲーム中のフロアID型を定義 */
 
-typedef int16_t BACT_IDX; /*!< 町の施設処理のID定義 */
-typedef int16_t BACT_RESTRICT_IDX; /*!< 町の施設処理の規制処理ID定義 */
-
 typedef int16_t MONRACE_IDX; /*!< @todo monster_race_typeに差し替えて消滅させる ゲーム中のモンスター種族ID型を定義 */
 typedef int16_t MONSTER_IDX; /*!< @todo monster_race_typeに差し替えて消滅させる ゲーム中のモンスター個体ID型を定義 */
 typedef int16_t DUNGEON_IDX; /*!< ゲーム中のダンジョンID型を定義 */