1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-10 03:39:55 +00:00

added getEquipmentSkill function to Class hierarchy

This commit is contained in:
Marc Zinnschlag 2012-03-13 14:12:07 +01:00
parent ea336214de
commit c314cddb1c
2 changed files with 13 additions and 2 deletions

View File

@ -127,11 +127,16 @@ namespace MWWorld
return Ogre::Vector3 (0, 0, 0);
}
std::pair<std::vector<int>, bool> Class::getEquipmentSlots (const Ptr& pt) const
std::pair<std::vector<int>, bool> Class::getEquipmentSlots (const Ptr& ptr) const
{
return std::make_pair (std::vector<int>(), false);
}
int Class::getEuqipmentSkill (const Ptr& ptr, const Environment& environment) const
{
return -1;
}
const Class& Class::get (const std::string& key)
{
std::map<std::string, boost::shared_ptr<Class> >::const_iterator iter = sClasses.find (key);

View File

@ -143,12 +143,18 @@ namespace MWWorld
///< Return desired movement vector (determined based on movement settings,
/// stance and stats).
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const Ptr& pt) const;
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const Ptr& ptr) const;
///< \return first: Return IDs of the slot this object can be equipped in; second: can object
/// stay stacked when equipped?
///
/// Default implementation: return (empty vector, false).
virtual int getEuqipmentSkill (const Ptr& ptr, const Environment& environment)
const;
/// Return the index of the skill this item corresponds to when equiopped or -1, if there is
/// no such skill.
/// (default implementation: return -1)
static const Class& get (const std::string& key);
///< If there is no class for this \a key, an exception is thrown.