2010-08-03 13:24:44 +00:00
|
|
|
#ifndef GAME_MWCLASS_DOOR_H
|
|
|
|
#define GAME_MWCLASS_DOOR_H
|
|
|
|
|
2014-02-23 19:11:05 +00:00
|
|
|
#include <components/esm/loaddoor.hpp>
|
|
|
|
|
2010-08-03 13:24:44 +00:00
|
|
|
#include "../mwworld/class.hpp"
|
|
|
|
|
|
|
|
namespace MWClass
|
|
|
|
{
|
|
|
|
class Door : public MWWorld::Class
|
|
|
|
{
|
2014-05-14 23:58:44 +00:00
|
|
|
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
|
|
|
|
2012-07-25 13:18:17 +00:00
|
|
|
virtual MWWorld::Ptr
|
2012-07-26 12:14:11 +00:00
|
|
|
copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const;
|
2012-07-25 13:18:17 +00:00
|
|
|
|
2010-08-03 13:24:44 +00:00
|
|
|
public:
|
|
|
|
|
2014-07-18 07:56:58 +00:00
|
|
|
/// Return ID of \a ptr
|
|
|
|
virtual std::string getId (const MWWorld::Ptr& ptr) const;
|
|
|
|
|
2011-11-12 04:01:12 +00:00
|
|
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
2010-08-14 08:02:54 +00:00
|
|
|
///< Add reference into a cell for rendering
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const;
|
2011-11-12 04:01:12 +00:00
|
|
|
|
2010-08-03 15:11:41 +00:00
|
|
|
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
|
|
|
/// can return an empty string.
|
2010-08-03 13:24:44 +00:00
|
|
|
|
2010-08-03 16:44:52 +00:00
|
|
|
virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
|
2012-04-23 13:27:03 +00:00
|
|
|
const MWWorld::Ptr& actor) const;
|
2010-08-03 16:44:52 +00:00
|
|
|
///< Generate action for activation
|
|
|
|
|
2012-04-16 20:58:16 +00:00
|
|
|
virtual bool hasToolTip (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< @return true if this object has a tooltip when focused (default implementation: false)
|
|
|
|
|
2012-04-24 00:02:03 +00:00
|
|
|
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
2012-04-16 20:58:16 +00:00
|
|
|
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
|
|
|
|
2012-12-23 19:23:24 +00:00
|
|
|
static std::string getDestination (const MWWorld::LiveCellRef<ESM::Door>& door);
|
|
|
|
///< @return destination cell name or token
|
|
|
|
|
2014-04-23 17:02:51 +00:00
|
|
|
virtual void lock (const MWWorld::Ptr& ptr, int lockLevel = 0) const;
|
2010-08-30 09:56:55 +00:00
|
|
|
///< Lock object
|
|
|
|
|
|
|
|
virtual void unlock (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Unlock object
|
|
|
|
|
2010-08-05 13:40:03 +00:00
|
|
|
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
|
|
|
///< Return name of the script attached to ptr
|
|
|
|
|
2010-08-03 13:24:44 +00:00
|
|
|
static void registerSelf();
|
2012-07-24 16:22:11 +00:00
|
|
|
|
|
|
|
virtual std::string getModel(const MWWorld::Ptr &ptr) const;
|
2014-05-14 23:58:44 +00:00
|
|
|
|
|
|
|
/// 0 = nothing, 1 = opening, 2 = closing
|
|
|
|
virtual int getDoorState (const MWWorld::Ptr &ptr) const;
|
|
|
|
/// This does not actually cause the door to move. Use World::activateDoor instead.
|
|
|
|
virtual void setDoorState (const MWWorld::Ptr &ptr, int state) const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual void readAdditionalState (const MWWorld::Ptr& ptr, const ESM::ObjectState& state)
|
|
|
|
const;
|
|
|
|
///< Read additional state from \a state into \a ptr.
|
|
|
|
|
|
|
|
virtual void writeAdditionalState (const MWWorld::Ptr& ptr, ESM::ObjectState& state)
|
|
|
|
const;
|
|
|
|
///< Write additional state from \a ptr into \a state.
|
2010-08-03 13:24:44 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|