OSDN Git Service

[Chore] UTF-8エンコーディングのファイルからBOMを削除
[hengbandforosx/hengbandosx.git] / src / system / item-entity.h
index 7f24515..f20a7fd 100644 (file)
@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 
 /*
  * @file item-entity.h
@@ -12,6 +12,7 @@
 #include "object-enchant/trc-types.h"
 #include "object/object-mark-types.h"
 #include "system/angband.h"
+#include "system/baseitem-info.h"
 #include "system/system-variables.h"
 #include "util/flag-group.h"
 #include <optional>
@@ -21,6 +22,9 @@ enum class ItemKindType : short;
 enum class SmithEffectType : int16_t;
 enum class RandomArtActType : short;
 
+class ArtifactType;
+class EgoItemDefinition;
+class BaseitemInfo;
 class ItemEntity {
 public:
     ItemEntity();
@@ -28,9 +32,7 @@ public:
     POSITION iy{}; /*!< Y-position on map, or zero */
     POSITION ix{}; /*!< X-position on map, or zero */
     IDX stack_idx{}; /*!< このアイテムを含むアイテムリスト内の位置(降順) */
-    ItemKindType tval{}; /*!< Item type (from kind) */
-
-    OBJECT_SUBTYPE_VALUE sval{}; /*!< Item sub-type (from kind) */
+    BaseitemKey bi_key;
     PARAMETER_VALUE pval{}; /*!< Item extra-parameter */
     byte discount{}; /*!< ゲーム中の値引き率 (0~100) / Discount (if any) */
     ITEM_NUMBER number{}; /*!< Number of items */
@@ -60,8 +62,8 @@ public:
     TIME_EFFECT timeout{}; /*!< Timeout Counter */
     byte ident{}; /*!< Special flags  */
     EnumClassFlagGroup<OmType> marked{}; /*!< Object is marked */
-    uint16_t inscription{}; /*!< Inscription index */
-    uint16_t art_name{}; /*!< Artifact name (random artifacts) */
+    std::optional<std::string> inscription{}; /*!< Inscription */
+    std::optional<std::string> randart_name{}; /*!< Artifact name (random artifacts) */
     byte feeling{}; /*!< Game generated inscription number (eg, pseudo-id) */
 
     TrFlags art_flags{}; /*!< Extra Flags for ego and artifacts */
@@ -95,7 +97,7 @@ public:
     bool is_rare() const;
     bool is_ego() const;
     bool is_smith() const;
-    bool is_artifact() const;
+    bool is_fixed_or_random_artifact() const;
     bool is_fixed_artifact() const;
     bool is_random_artifact() const;
     bool is_nameless() const;
@@ -130,6 +132,14 @@ public:
     int get_arrow_magnification() const;
     bool is_aiming_rod() const;
     bool is_lite_requiring_fuel() const;
+    bool is_junk() const;
+    bool is_armour() const;
+    bool is_cross_bow() const;
+    bool is_inscribed() const;
+
+    BaseitemInfo &get_baseitem() const;
+    EgoItemDefinition &get_ego() const;
+    ArtifactType &get_fixed_artifact() const;
 
 private:
     int get_baseitem_price() const;