OSDN Git Service

[Refactor] #1621 デバッグ用tvalリストを静的配列からvectorに変換した
authorHourier <66951241+Hourier@users.noreply.github.com>
Thu, 23 Sep 2021 05:22:27 +0000 (14:22 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Fri, 24 Sep 2021 11:35:40 +0000 (20:35 +0900)
src/wizard/tval-descriptions-table.cpp
src/wizard/tval-descriptions-table.h

index 16e7b33..73b6a1c 100644 (file)
@@ -4,7 +4,7 @@
 /*!
  * ベースアイテムの大項目IDの種別名定義 / A list of tvals and their textual names
  */
-tval_desc tvals[MAX_TVAL_DESCRIPTIONS] = {
+const std::vector<tval_desc> tvals = {
     { TV_SWORD, _("刀剣", "Sword") },
     { TV_POLEARM, _("長柄/斧", "Polearm") },
     { TV_HAFTED, _("鈍器", "Hafted Weapon") },
@@ -63,6 +63,9 @@ tval_desc tvals[MAX_TVAL_DESCRIPTIONS] = {
  * 選択処理用キーコード /
  * Global array for converting numbers to a logical list symbol
  */
-const char listsym[MAX_DEBUG_COMMAND_SYMBOLS] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
-    'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
-    'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '\0' };
+const std::vector<char> listsym = {
+    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+    '\0'
+};
index c70a930..76a2d2b 100644 (file)
@@ -1,6 +1,7 @@
 #pragma once
 
 #include "system/angband.h"
+#include <vector>
 
 /*!
  * ベースアイテムの大項目IDの種別名をまとめる構造体 / A structure to hold a tval and its description
@@ -10,8 +11,5 @@ typedef struct tval_desc {
     concptr desc; /*!< 大項目名 */
 } tval_desc;
 
-#define MAX_TVAL_DESCRIPTIONS 52
-#define MAX_DEBUG_COMMAND_SYMBOLS 63
-
-extern tval_desc tvals[MAX_TVAL_DESCRIPTIONS];
-extern const char listsym[MAX_DEBUG_COMMAND_SYMBOLS];
+extern const std::vector<tval_desc> tvals;
+extern const std::vector<char> listsym;