1 #ifndef GAME_MWCLASS_ARMOR_H
2 #define GAME_MWCLASS_ARMOR_H
3 
4 #include "../mwworld/class.hpp"
5 
6 namespace MWClass
7 {
8     class Armor : public MWWorld::Class
9     {
10             MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const override;
11 
12         public:
13 
14             float getWeight (const MWWorld::ConstPtr& ptr) const override;
15 
16             void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
17             ///< Add reference into a cell for rendering
18 
19             void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const override;
20 
21             std::string getName (const MWWorld::ConstPtr& ptr) const override;
22             ///< \return name or ID; can return an empty string.
23 
24             std::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
25                 const MWWorld::Ptr& actor) const override;
26             ///< Generate action for activation
27 
28             bool hasItemHealth (const MWWorld::ConstPtr& ptr) const override;
29             ///< \return Item health data available?
30 
31             int getItemMaxHealth (const MWWorld::ConstPtr& ptr) const override;
32             ///< Return item max health or throw an exception, if class does not have item health
33 
34             std::string getScript (const MWWorld::ConstPtr& ptr) const override;
35             ///< Return name of the script attached to ptr
36 
37             std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::ConstPtr& ptr) const override;
38             ///< \return first: Return IDs of the slot this object can be equipped in; second: can object
39             /// stay stacked when equipped?
40 
41             int getEquipmentSkill (const MWWorld::ConstPtr& ptr) const override;
42             /// Return the index of the skill this item corresponds to when equipped or -1, if there is
43             /// no such skill.
44 
45             MWGui::ToolTipInfo getToolTipInfo (const MWWorld::ConstPtr& ptr, int count) const override;
46             ///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
47 
48             int getValue (const MWWorld::ConstPtr& ptr) const override;
49             ///< Return trade value of the object. Throws an exception, if the object can't be traded.
50 
51             static void registerSelf();
52 
53             std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const override;
54             ///< Return the pick up sound Id
55 
56             std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const override;
57             ///< Return the put down sound Id
58 
59             std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const override;
60             ///< Return name of inventory icon.
61 
62             std::string getEnchantment (const MWWorld::ConstPtr& ptr) const override;
63             ///< @return the enchantment ID if the object is enchanted, otherwise an empty string
64 
65             std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const override;
66             ///< Creates a new record using \a ptr as template, with the given name and the given enchantment applied to it.
67 
68             std::pair<int, std::string> canBeEquipped(const MWWorld::ConstPtr &ptr, const MWWorld::Ptr &npc) const override;
69             ///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. \n
70             ///  Second item in the pair specifies the error message
71 
72             std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr, bool force=false) const override;
73             ///< Generate action for using via inventory menu
74 
75             std::string getModel(const MWWorld::ConstPtr &ptr) const override;
76 
77             int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const override;
78 
79             bool canSell (const MWWorld::ConstPtr& item, int npcServices) const override;
80 
81             /// Get the effective armor rating, factoring in the actor's skills, for the given armor.
82             float getEffectiveArmorRating(const MWWorld::ConstPtr& armor, const MWWorld::Ptr& actor) const override;
83     };
84 }
85 
86 #endif
87