OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
weapon.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWCLASS_WEAPON_H
2 #define GAME_MWCLASS_WEAPON_H
3 
4 #include "../mwworld/class.hpp"
5 
6 namespace MWClass
7 {
8  class Weapon : public MWWorld::Class
9  {
10  virtual MWWorld::Ptr
11  copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
12 
13  public:
14 
15  virtual void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const;
17 
18  virtual void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const;
19 
20  virtual std::string getName (const MWWorld::ConstPtr& ptr) const;
23 
24  virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
25  const MWWorld::Ptr& actor) const;
27 
28  virtual bool hasToolTip (const MWWorld::ConstPtr& ptr) const;
30 
31  virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::ConstPtr& ptr, int count) const;
33 
34  virtual bool hasItemHealth (const MWWorld::ConstPtr& ptr) const;
36 
37  virtual int getItemMaxHealth (const MWWorld::ConstPtr& ptr) const;
39 
40  virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
42 
43  virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::ConstPtr& ptr) const;
46 
47  virtual int getEquipmentSkill (const MWWorld::ConstPtr& ptr) const;
50 
51  virtual int getValue (const MWWorld::ConstPtr& ptr) const;
53 
54  static void registerSelf();
55 
56  virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
58 
59  virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
61 
62  virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
64 
65  virtual std::string getEnchantment (const MWWorld::ConstPtr& ptr) const;
67 
68  virtual std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;
70 
71  virtual std::pair<int, std::string> canBeEquipped(const MWWorld::ConstPtr &ptr, const MWWorld::Ptr &npc) const;
74 
75  virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)
76  const;
78 
79  virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
80 
81  virtual bool canSell (const MWWorld::ConstPtr& item, int npcServices) const;
82 
83  virtual float getWeight (const MWWorld::ConstPtr& ptr) const;
84 
85  virtual int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const;
86  };
87 }
88 
89 #endif
Definition: tooltips.hpp:18
static void registerSelf()
Definition: weapon.cpp:143
virtual int getItemMaxHealth(const MWWorld::ConstPtr &ptr) const
Return item max health or throw an exception, if class does not have item health. ...
Definition: weapon.cpp:69
virtual bool hasItemHealth(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:62
virtual std::string getName(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:49
virtual bool canSell(const MWWorld::ConstPtr &item, int npcServices) const
Determine whether or not item can be sold to an npc with the given npcServices.
Definition: weapon.cpp:407
Definition: weapon.hpp:8
Definition: renderinginterface.hpp:9
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:38
Definition: physicssystem.hpp:51
Base class for referenceable esm records.
Definition: class.hpp:52
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
Definition: weapon.cpp:393
virtual void insertObject(const MWWorld::Ptr &ptr, const std::string &model, MWPhysics::PhysicsSystem &physics) const
Add reference into a cell for rendering (default implementation: don't render anything).
Definition: weapon.cpp:33
virtual std::string getDownSoundId(const MWWorld::ConstPtr &ptr) const
Return the put down sound Id.
Definition: weapon.cpp:194
virtual std::string getUpSoundId(const MWWorld::ConstPtr &ptr) const
Return the pick up sound Id.
Definition: weapon.cpp:150
virtual std::string getInventoryIcon(const MWWorld::ConstPtr &ptr) const
Return name of inventory icon.
Definition: weapon.cpp:238
virtual boost::shared_ptr< MWWorld::Action > activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
Generate action for activation.
Definition: weapon.cpp:56
Mutable state of a cell.
Definition: cellstore.hpp:53
virtual std::string getEnchantment(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:339
Pointer to a const LiveCellRef.
Definition: ptr.hpp:90
virtual int getEquipmentSkill(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:107
virtual std::pair< std::vector< int >, bool > getEquipmentSlots(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:84
virtual std::string getScript(const MWWorld::ConstPtr &ptr) const
Return name of the script attached to ptr.
Definition: weapon.cpp:76
virtual int getEnchantmentPoints(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:400
virtual std::pair< int, std::string > canBeEquipped(const MWWorld::ConstPtr &ptr, const MWWorld::Ptr &npc) const
Definition: weapon.cpp:360
virtual void insertObjectRendering(const MWWorld::Ptr &ptr, const std::string &model, MWRender::RenderingInterface &renderingInterface) const
Add reference into a cell for rendering.
Definition: weapon.cpp:26
virtual boost::shared_ptr< MWWorld::Action > use(const MWWorld::Ptr &ptr) const
Generate action for using via inventory menu.
Definition: weapon.cpp:384
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual int getValue(const MWWorld::ConstPtr &ptr) const
Return trade value of the object. Throws an exception, if the object can't be traded.
Definition: weapon.cpp:136
virtual float getWeight(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:413
virtual std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string &enchId, int enchCharge, const std::string &newName) const
Creates a new record using ptr as template, with the given name and the given enchantment applied to ...
Definition: weapon.cpp:346
virtual bool hasToolTip(const MWWorld::ConstPtr &ptr) const
Definition: weapon.cpp:245
virtual MWGui::ToolTipInfo getToolTipInfo(const MWWorld::ConstPtr &ptr, int count) const
Definition: weapon.cpp:252