OpenMW
Public Member Functions | Static Public Member Functions | Private Member Functions
MWClass::Light Class Reference

#include <light.hpp>

List of all members.

Public Member Functions

virtual void insertObjectRendering (const MWWorld::Ptr &ptr, MWRender::RenderingInterface &renderingInterface) const
 Add reference into a cell for rendering.
virtual void insertObject (const MWWorld::Ptr &ptr, MWWorld::PhysicsSystem &physics) const
 Add reference into a cell for rendering (default implementation: don't render anything).
virtual std::string getName (const MWWorld::Ptr &ptr) const
virtual bool hasToolTip (const MWWorld::Ptr &ptr) const
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr &ptr) const
virtual boost::shared_ptr
< MWWorld::Action
activate (const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
 Generate action for activation.
virtual std::string getScript (const MWWorld::Ptr &ptr) const
 Return name of the script attached to ptr.
virtual std::pair< std::vector
< int >, bool > 
getEquipmentSlots (const MWWorld::Ptr &ptr) const
virtual int getValue (const MWWorld::Ptr &ptr) const
 Return trade value of the object. Throws an exception, if the object can't be traded.
virtual std::string getUpSoundId (const MWWorld::Ptr &ptr) const
 Return the pick up sound Id.
virtual std::string getDownSoundId (const MWWorld::Ptr &ptr) const
 Return the put down sound Id.
virtual std::string getInventoryIcon (const MWWorld::Ptr &ptr) const
 Return name of inventory icon.
virtual boost::shared_ptr
< MWWorld::Action
use (const MWWorld::Ptr &ptr) const
 Generate action for using via inventory menu.
virtual void setRemainingUsageTime (const MWWorld::Ptr &ptr, float duration) const
 Sets the remaining duration of the object.
virtual float getRemainingUsageTime (const MWWorld::Ptr &ptr) const
 Returns the remaining duration of the object.
virtual std::string getModel (const MWWorld::Ptr &ptr) const
virtual float getWeight (const MWWorld::Ptr &ptr) const
virtual bool canSell (const MWWorld::Ptr &item, int npcServices) const
 Determine whether or not item can be sold to an npc with the given npcServices.
std::pair< int, std::string > canBeEquipped (const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const

Static Public Member Functions

static void registerSelf ()

Private Member Functions

virtual MWWorld::Ptr copyToCellImpl (const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
void ensureCustomData (const MWWorld::Ptr &ptr) const

Member Function Documentation

boost::shared_ptr< MWWorld::Action > MWClass::Light::activate ( const MWWorld::Ptr ptr,
const MWWorld::Ptr actor 
) const [virtual]

Generate action for activation.

Reimplemented from MWWorld::Class.

std::pair< int, std::string > MWClass::Light::canBeEquipped ( const MWWorld::Ptr ptr,
const MWWorld::Ptr npc 
) const [virtual]

Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that. Second item in the pair specifies the error message

Todo:
the 2h check is repeated many times; put it in a function

Reimplemented from MWWorld::Class.

bool MWClass::Light::canSell ( const MWWorld::Ptr item,
int  npcServices 
) const [virtual]

Determine whether or not item can be sold to an npc with the given npcServices.

Reimplemented from MWWorld::Class.

MWWorld::Ptr MWClass::Light::copyToCellImpl ( const MWWorld::Ptr ptr,
MWWorld::CellStore cell 
) const [private, virtual]

Reimplemented from MWWorld::Class.

void MWClass::Light::ensureCustomData ( const MWWorld::Ptr ptr) const [private]
std::string MWClass::Light::getDownSoundId ( const MWWorld::Ptr ptr) const [virtual]

Return the put down sound Id.

Reimplemented from MWWorld::Class.

std::pair< std::vector< int >, bool > MWClass::Light::getEquipmentSlots ( const MWWorld::Ptr ptr) const [virtual]
Returns:
first: Return IDs of the slot this object can be equipped in; second: can object stay stacked when equipped?

Reimplemented from MWWorld::Class.

std::string MWClass::Light::getInventoryIcon ( const MWWorld::Ptr ptr) const [virtual]

Return name of inventory icon.

Reimplemented from MWWorld::Class.

std::string MWClass::Light::getModel ( const MWWorld::Ptr ptr) const [virtual]

Reimplemented from MWWorld::Class.

std::string MWClass::Light::getName ( const MWWorld::Ptr ptr) const [virtual]
Returns:
name (the one that is to be presented to the user; not the internal one); can return an empty string.

Implements MWWorld::Class.

float MWClass::Light::getRemainingUsageTime ( const MWWorld::Ptr ptr) const [virtual]

Returns the remaining duration of the object.

Reimplemented from MWWorld::Class.

std::string MWClass::Light::getScript ( const MWWorld::Ptr ptr) const [virtual]

Return name of the script attached to ptr.

Reimplemented from MWWorld::Class.

Returns:
the content of the tool tip to be displayed. raises exception if the object has no tooltip.

Reimplemented from MWWorld::Class.

std::string MWClass::Light::getUpSoundId ( const MWWorld::Ptr ptr) const [virtual]

Return the pick up sound Id.

Reimplemented from MWWorld::Class.

int MWClass::Light::getValue ( const MWWorld::Ptr ptr) const [virtual]

Return trade value of the object. Throws an exception, if the object can't be traded.

Reimplemented from MWWorld::Class.

float MWClass::Light::getWeight ( const MWWorld::Ptr ptr) const [virtual]

Reimplemented from MWWorld::Class.

bool MWClass::Light::hasToolTip ( const MWWorld::Ptr ptr) const [virtual]
Returns:
true if this object has a tooltip when focused (default implementation: false)

Reimplemented from MWWorld::Class.

void MWClass::Light::insertObject ( const MWWorld::Ptr ptr,
MWWorld::PhysicsSystem physics 
) const [virtual]

Add reference into a cell for rendering (default implementation: don't render anything).

Reimplemented from MWWorld::Class.

void MWClass::Light::insertObjectRendering ( const MWWorld::Ptr ptr,
MWRender::RenderingInterface renderingInterface 
) const [virtual]

Add reference into a cell for rendering.

Reimplemented from MWWorld::Class.

void MWClass::Light::registerSelf ( ) [static]
void MWClass::Light::setRemainingUsageTime ( const MWWorld::Ptr ptr,
float  duration 
) const [virtual]

Sets the remaining duration of the object.

Reimplemented from MWWorld::Class.

boost::shared_ptr< MWWorld::Action > MWClass::Light::use ( const MWWorld::Ptr ptr) const [virtual]

Generate action for using via inventory menu.

Reimplemented from MWWorld::Class.


The documentation for this class was generated from the following files: