* @param a_ptr 固定アーティファクト情報への参照ポインタ
* @param q_ptr オブジェクト情報への参照ポインタ
*/
-static void fixed_artifact_random_abilities(PlayerType *player_ptr, artifact_type *a_ptr, ObjectType *o_ptr)
+static void fixed_artifact_random_abilities(PlayerType *player_ptr, ArtifactType *a_ptr, ObjectType *o_ptr)
{
auto give_power = false;
auto give_resistance = false;
* @param a_ptr 固定アーティファクト情報への参照ポインタ
* @param q_ptr オブジェクト情報への参照ポインタ
*/
-static void invest_curse_to_fixed_artifact(artifact_type *a_ptr, ObjectType *o_ptr)
+static void invest_curse_to_fixed_artifact(ArtifactType *a_ptr, ObjectType *o_ptr)
{
if (!a_ptr->cost) {
set_bits(o_ptr->ident, IDENT_BROKEN);
* @param o_ptr 生成に割り当てたいオブジェクトの構造体参照ポインタ
* @return 適用したアーティファクト情報への参照ポインタ
*/
-artifact_type *apply_artifact(PlayerType *player_ptr, ObjectType *o_ptr)
+ArtifactType *apply_artifact(PlayerType *player_ptr, ObjectType *o_ptr)
{
auto a_ptr = &a_info[enum2i(o_ptr->fixed_artifact_idx)];
o_ptr->pval = a_ptr->pval;
#include "system/angband.h"
enum class FixedArtifactId : short;
-struct artifact_type;
+class ArtifactType;
class ObjectType;
class PlayerType;
bool create_named_art(PlayerType *player_ptr, FixedArtifactId a_idx, POSITION y, POSITION x);
bool make_artifact(PlayerType *player_ptr, ObjectType *o_ptr);
-artifact_type *apply_artifact(PlayerType *player_ptr, ObjectType *o_ptr);
+ArtifactType *apply_artifact(PlayerType *player_ptr, ObjectType *o_ptr);
bool make_artifact_special(PlayerType *player_ptr, ObjectType *o_ptr);
}
monster_race *r_ptr;
- artifact_type *a_ptr;
+ ArtifactType *a_ptr;
if (num < 9) {
return true;
* @param what 参照元の文字列ポインタ
* @return 見つかったらtrue
*/
-static bool grab_one_artifact_flag(artifact_type *a_ptr, std::string_view what)
+static bool grab_one_artifact_flag(ArtifactType *a_ptr, std::string_view what)
{
if (TrFlags::grab_one_flag(a_ptr->flags, k_info_flags, what)) {
return true;
*/
errr parse_a_info(std::string_view buf, angband_header *)
{
- static artifact_type *a_ptr = nullptr;
+ static ArtifactType *a_ptr = nullptr;
const auto &tokens = str_split(buf, ':', false, 10);
if (tokens[0] == "N") {
void ItemLoaderBase::load_artifact(void)
{
auto loading_max_a_idx = rd_u16b();
- artifact_type dummy;
+ ArtifactType dummy;
for (auto i = 0U; i < loading_max_a_idx; i++) {
auto *a_ptr = i < a_info.size() ? &a_info[i] : &dummy;
a_ptr->is_generated = rd_bool();
}
FixedArtifactId a_idx = FixedArtifactId::NONE;
- artifact_type *a_ptr = nullptr;
+ ArtifactType *a_ptr = nullptr;
do {
switch (randint0(3)) {
case 0:
char fullname[1024] = "";
if (strcmp(zz[0], "ARTIFACT") == 0) {
FixedArtifactId a_idx;
- artifact_type *a_ptr;
+ ArtifactType *a_ptr;
while (true) {
a_idx = i2enum<FixedArtifactId>(rumor_num(zz[1], static_cast<IDX>(a_info.size())));
/*
* The artifact arrays
*/
-std::vector<artifact_type> a_info;
+std::vector<ArtifactType> a_info;
#include "object-enchant/trg-types.h"
#include "system/object-type-definition.h"
#include "util/flag-group.h"
-
#include <string>
#include <vector>
/*!
- * @struct artifact_type
+ * @class ArtifactType
* @brief 固定アーティファクト情報の構造体 / Artifact structure.
- * @details
- * @note
- * the save-file only writes "is_generated" to the savefile.
- * "max_num" is always "1" (if that artifact "exists")
+ * @details is_generated フィールドのみセーブファイルへの保存対象
*/
enum class FixedArtifactId : short;
enum class RandomArtActType : short;
-struct artifact_type {
+class ArtifactType {
+public:
+ ArtifactType() = default;
FixedArtifactId idx{};
std::string name; /*!< アーティファクト名 / Name */
RandomArtActType act_idx{}; /*! 発動能力ID / Activative ability index */
};
-extern std::vector<artifact_type> a_info;
+extern std::vector<ArtifactType> a_info;
KIND_OBJECT_IDX k_idx = k_ids.back();
auto *k_ptr = &k_info[k_idx];
- artifact_type *a_ptr;
+ ArtifactType *a_ptr;
FixedArtifactId a_idx = FixedArtifactId::NONE;
if (k_ptr->gen_flags.has(ItemGenerationTraitType::INSTA_ART)) {
for (const auto &a_ref : a_info) {