OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
door.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWCLASS_DOOR_H
2 #define GAME_MWCLASS_DOOR_H
3 
5 
6 #include "../mwworld/class.hpp"
7 
8 namespace MWClass
9 {
10  class Door : public MWWorld::Class
11  {
12  void ensureCustomData (const MWWorld::Ptr& ptr) const;
13 
14  virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
15 
16  public:
17 
18  virtual void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const;
20 
21  virtual void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const;
22 
23  virtual std::string getName (const MWWorld::ConstPtr& ptr) const;
26 
27  virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
28  const MWWorld::Ptr& actor) const;
30 
31  virtual bool hasToolTip (const MWWorld::ConstPtr& ptr) const;
33 
34  virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::ConstPtr& ptr, int count) const;
36 
37  static std::string getDestination (const MWWorld::LiveCellRef<ESM::Door>& door);
39 
40  virtual void lock (const MWWorld::Ptr& ptr, int lockLevel = 0) const;
42 
43  virtual void unlock (const MWWorld::Ptr& ptr) const;
45 
46  virtual bool canLock(const MWWorld::ConstPtr &ptr) const;
47 
48  virtual bool allowTelekinesis(const MWWorld::ConstPtr &ptr) const;
50 
51  virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
53 
54  static void registerSelf();
55 
56  virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
57 
59  virtual int getDoorState (const MWWorld::ConstPtr &ptr) const;
61  virtual void setDoorState (const MWWorld::Ptr &ptr, int state) const;
62 
63 
64  virtual void readAdditionalState (const MWWorld::Ptr& ptr, const ESM::ObjectState& state)
65  const;
67 
68  virtual void writeAdditionalState (const MWWorld::ConstPtr& ptr, ESM::ObjectState& state)
69  const;
71  };
72 }
73 
74 #endif
Definition: tooltips.hpp:18
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: door.cpp:63
virtual bool allowTelekinesis(const MWWorld::ConstPtr &ptr) const
Return whether this class of object can be activated with telekinesis.
Definition: door.cpp:247
static void registerSelf()
Definition: door.cpp:262
virtual void lock(const MWWorld::Ptr &ptr, int lockLevel=0) const
Lock object.
Definition: door.cpp:229
virtual std::string getScript(const MWWorld::ConstPtr &ptr) const
Return name of the script attached to ptr.
Definition: door.cpp:255
virtual MWGui::ToolTipInfo getToolTipInfo(const MWWorld::ConstPtr &ptr, int count) const
Definition: door.cpp:276
Definition: renderinginterface.hpp:9
Definition: livecellref.hpp:77
Definition: physicssystem.hpp:51
virtual std::string getName(const MWWorld::ConstPtr &ptr) const
Definition: door.cpp:92
Base class for referenceable esm records.
Definition: class.hpp:52
virtual void insertObjectRendering(const MWWorld::Ptr &ptr, const std::string &model, MWRender::RenderingInterface &renderingInterface) const
Add reference into a cell for rendering.
Definition: door.cpp:56
virtual void readAdditionalState(const MWWorld::Ptr &ptr, const ESM::ObjectState &state) const
Read additional state from state into ptr.
Definition: door.cpp:375
void ensureCustomData(const MWWorld::Ptr &ptr) const
Definition: door.cpp:346
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const
Definition: door.cpp:81
Definition: door.hpp:10
<
Definition: objectstate.hpp:19
Mutable state of a cell.
Definition: cellstore.hpp:53
Pointer to a const LiveCellRef.
Definition: ptr.hpp:90
virtual int getDoorState(const MWWorld::ConstPtr &ptr) const
0 = nothing, 1 = opening, 2 = closing
Definition: door.cpp:357
virtual bool hasToolTip(const MWWorld::ConstPtr &ptr) const
Definition: door.cpp:269
virtual void setDoorState(const MWWorld::Ptr &ptr, int state) const
This does not actually cause the door to move. Use World::activateDoor instead.
Definition: door.cpp:365
virtual void writeAdditionalState(const MWWorld::ConstPtr &ptr, ESM::ObjectState &state) const
Write additional state from ptr into state.
Definition: door.cpp:386
virtual bool canLock(const MWWorld::ConstPtr &ptr) const
Definition: door.cpp:242
virtual void unlock(const MWWorld::Ptr &ptr) const
Unlock object.
Definition: door.cpp:237
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
static std::string getDestination(const MWWorld::LiveCellRef< ESM::Door > &door)
Definition: door.cpp:308
virtual MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const
Definition: door.cpp:339
virtual boost::shared_ptr< MWWorld::Action > activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
Generate action for activation.
Definition: door.cpp:99