mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-01 00:32:52 +00:00
Accept a ConstPtr in getScript
This commit is contained in:
parent
eb51e2838f
commit
b48445dea7
@ -66,9 +66,9 @@ namespace MWClass
|
||||
return ref->mBase->mName;
|
||||
}
|
||||
|
||||
std::string Activator::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Activator::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
const MWWorld::LiveCellRef<ESM::Activator> *ref =
|
||||
ptr.get<ESM::Activator>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
|
@ -31,7 +31,7 @@ namespace MWClass
|
||||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const;
|
||||
|
@ -64,10 +64,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Apparatus::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Apparatus::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Apparatus> *ref =
|
||||
ptr.get<ESM::Apparatus>();
|
||||
const MWWorld::LiveCellRef<ESM::Apparatus> *ref = ptr.get<ESM::Apparatus>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ namespace MWClass
|
||||
const MWWorld::Ptr& actor) const;
|
||||
///< Generate action for activation
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual int getValue (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -83,10 +83,9 @@ namespace MWClass
|
||||
return ref->mBase->mData.mHealth;
|
||||
}
|
||||
|
||||
std::string Armor::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Armor::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Armor> *ref =
|
||||
ptr.get<ESM::Armor>();
|
||||
const MWWorld::LiveCellRef<ESM::Armor> *ref = ptr.get<ESM::Armor>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ namespace MWClass
|
||||
virtual int getItemMaxHealth (const MWWorld::Ptr& ptr) const;
|
||||
///< Return item max health or throw an exception, if class does not have item health
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -78,10 +78,9 @@ namespace MWClass
|
||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionRead(ptr));
|
||||
}
|
||||
|
||||
std::string Book::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Book::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Book> *ref =
|
||||
ptr.get<ESM::Book>();
|
||||
const MWWorld::LiveCellRef<ESM::Book> *ref = ptr.get<ESM::Book>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace MWClass
|
||||
const MWWorld::Ptr& actor) const;
|
||||
///< Generate action for activation
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual bool hasToolTip (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -66,10 +66,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Clothing::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Clothing::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace MWClass
|
||||
const MWWorld::Ptr& actor) const;
|
||||
///< Generate action for activation
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -209,10 +209,9 @@ namespace MWClass
|
||||
return ptr.getRefData().getCustomData()->asContainerCustomData().mContainerStore;
|
||||
}
|
||||
|
||||
std::string Container::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Container::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Container> *ref =
|
||||
ptr.get<ESM::Container>();
|
||||
const MWWorld::LiveCellRef<ESM::Container> *ref = ptr.get<ESM::Container>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ namespace MWClass
|
||||
virtual MWWorld::ContainerStore& getContainerStore (const MWWorld::Ptr& ptr) const;
|
||||
///< Return container store
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual float getCapacity (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -444,9 +444,9 @@ namespace MWClass
|
||||
return isFlagBitSet(ptr, ESM::Creature::Weapon);
|
||||
}
|
||||
|
||||
std::string Creature::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Creature::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
const MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ namespace MWClass
|
||||
|
||||
virtual bool hasInventoryStore (const MWWorld::Ptr &ptr) const;
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual float getCapacity (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -217,10 +217,9 @@ namespace MWClass
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string Door::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Door::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Door> *ref =
|
||||
ptr.get<ESM::Door>();
|
||||
const MWWorld::LiveCellRef<ESM::Door> *ref = ptr.get<ESM::Door>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ namespace MWClass
|
||||
|
||||
virtual bool canLock(const MWWorld::Ptr &ptr) const;
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
static void registerSelf();
|
||||
|
@ -70,10 +70,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Ingredient::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Ingredient::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Ingredient> *ref =
|
||||
ptr.get<ESM::Ingredient>();
|
||||
const MWWorld::LiveCellRef<ESM::Ingredient> *ref = ptr.get<ESM::Ingredient>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
||||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual int getValue (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -96,10 +96,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Light::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Light::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Light> *ref =
|
||||
ptr.get<ESM::Light>();
|
||||
const MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
||||
const MWWorld::Ptr& actor) const;
|
||||
///< Generate action for activation
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -65,10 +65,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Lockpick::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Lockpick::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Lockpick> *ref =
|
||||
ptr.get<ESM::Lockpick>();
|
||||
const MWWorld::LiveCellRef<ESM::Lockpick> *ref = ptr.get<ESM::Lockpick>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
||||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -78,10 +78,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Miscellaneous::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Miscellaneous::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
const MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
||||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual int getValue (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -799,10 +799,9 @@ namespace MWClass
|
||||
return ptr.getRefData().getCustomData()->asNpcCustomData().mInventoryStore;
|
||||
}
|
||||
|
||||
std::string Npc::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Npc::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref =
|
||||
ptr.get<ESM::NPC>();
|
||||
const MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ namespace MWClass
|
||||
const MWWorld::Ptr& actor) const;
|
||||
///< Generate action for activation
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual float getSpeed (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -68,9 +68,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Potion::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Potion::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
const MWWorld::LiveCellRef<ESM::Potion> *ref =
|
||||
ptr.get<ESM::Potion>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
||||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual int getValue (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -64,9 +64,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Probe::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Probe::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
const MWWorld::LiveCellRef<ESM::Probe> *ref =
|
||||
ptr.get<ESM::Probe>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
||||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -64,9 +64,9 @@ namespace MWClass
|
||||
return defaultItemActivate(ptr, actor);
|
||||
}
|
||||
|
||||
std::string Repair::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Repair::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
const MWWorld::LiveCellRef<ESM::Repair> *ref =
|
||||
ptr.get<ESM::Repair>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
|
@ -34,7 +34,7 @@ namespace MWClass
|
||||
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::Ptr& ptr) const;
|
||||
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual int getValue (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -84,9 +84,9 @@ namespace MWClass
|
||||
return ref->mBase->mData.mHealth;
|
||||
}
|
||||
|
||||
std::string Weapon::getScript (const MWWorld::Ptr& ptr) const
|
||||
std::string Weapon::getScript (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
const MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
|
||||
return ref->mBase->mScript;
|
||||
|
@ -40,7 +40,7 @@ namespace MWClass
|
||||
virtual int getItemMaxHealth (const MWWorld::Ptr& ptr) const;
|
||||
///< Return item max health or throw an exception, if class does not have item health
|
||||
|
||||
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr
|
||||
|
||||
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::Ptr& ptr) const;
|
||||
|
@ -158,7 +158,7 @@ namespace MWWorld
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::string Class::getScript (const Ptr& ptr) const
|
||||
std::string Class::getScript (const ConstPtr& ptr) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ namespace MWWorld
|
||||
///< Returns the remaining duration of the object, such as an equippable light
|
||||
/// source. (default implementation: -1, i.e. infinite)
|
||||
|
||||
virtual std::string getScript (const Ptr& ptr) const;
|
||||
virtual std::string getScript (const ConstPtr& ptr) const;
|
||||
///< Return name of the script attached to ptr (default implementation: return an empty
|
||||
/// string).
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user