From b613ce31718c8b6797fbcf4582edb3ca8423a334 Mon Sep 17 00:00:00 2001 From: Hourier <66951241+Hourier@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:22:27 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#1621=20=E3=83=87=E3=83=90=E3=83=83?= =?utf8?q?=E3=82=B0=E7=94=A8tval=E3=83=AA=E3=82=B9=E3=83=88=E3=82=92?= =?utf8?q?=E9=9D=99=E7=9A=84=E9=85=8D=E5=88=97=E3=81=8B=E3=82=89vector?= =?utf8?q?=E3=81=AB=E5=A4=89=E6=8F=9B=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/wizard/tval-descriptions-table.cpp | 11 +++++++---- src/wizard/tval-descriptions-table.h | 8 +++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/wizard/tval-descriptions-table.cpp b/src/wizard/tval-descriptions-table.cpp index 16e7b33df..73b6a1cc3 100644 --- a/src/wizard/tval-descriptions-table.cpp +++ b/src/wizard/tval-descriptions-table.cpp @@ -4,7 +4,7 @@ /*! * ベースアイテムの大項目IDの種別名定義 / A list of tvals and their textual names */ -tval_desc tvals[MAX_TVAL_DESCRIPTIONS] = { +const std::vector 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 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' +}; diff --git a/src/wizard/tval-descriptions-table.h b/src/wizard/tval-descriptions-table.h index c70a930a8..76a2d2bcc 100644 --- a/src/wizard/tval-descriptions-table.h +++ b/src/wizard/tval-descriptions-table.h @@ -1,6 +1,7 @@ #pragma once #include "system/angband.h" +#include /*! * ベースアイテムの大項目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 tvals; +extern const std::vector listsym; -- 2.11.0