Accept a ConstPtr in getInventoryIcon

openmw-38
scrawl 9 years ago
parent f258c5c508
commit beb8805a12

@ -92,10 +92,9 @@ namespace MWClass
return std::string("Item Apparatus Down"); return std::string("Item Apparatus Down");
} }
std::string Apparatus::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Apparatus::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Apparatus> *ref = const MWWorld::LiveCellRef<ESM::Apparatus> *ref = ptr.get<ESM::Apparatus>();
ptr.get<ESM::Apparatus>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -51,7 +51,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)

@ -199,10 +199,9 @@ namespace MWClass
return std::string("Item Armor Heavy Down"); return std::string("Item Armor Heavy Down");
} }
std::string Armor::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Armor::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Armor> *ref = const MWWorld::LiveCellRef<ESM::Armor> *ref = ptr.get<ESM::Armor>();
ptr.get<ESM::Armor>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -64,7 +64,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const; virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;

@ -106,10 +106,9 @@ namespace MWClass
return std::string("Item Book Down"); return std::string("Item Book Down");
} }
std::string Book::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Book::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Book> *ref = const MWWorld::LiveCellRef<ESM::Book> *ref = ptr.get<ESM::Book>();
ptr.get<ESM::Book>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -48,7 +48,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const; virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;

@ -158,10 +158,9 @@ namespace MWClass
return std::string("Item Clothes Down"); return std::string("Item Clothes Down");
} }
std::string Clothing::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Clothing::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Clothing> *ref = const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
ptr.get<ESM::Clothing>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -56,7 +56,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const; virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;

@ -108,10 +108,9 @@ namespace MWClass
return std::string("Item Ingredient Down"); return std::string("Item Ingredient Down");
} }
std::string Ingredient::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Ingredient::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Ingredient> *ref = const MWWorld::LiveCellRef<ESM::Ingredient> *ref = ptr.get<ESM::Ingredient>();
ptr.get<ESM::Ingredient>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -52,7 +52,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;

@ -138,10 +138,9 @@ namespace MWClass
} }
std::string Light::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Light::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Light> *ref = const MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>();
ptr.get<ESM::Light>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -52,7 +52,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)

@ -102,10 +102,9 @@ namespace MWClass
return std::string("Item Lockpick Down"); return std::string("Item Lockpick Down");
} }
std::string Lockpick::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Lockpick::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Lockpick> *ref = const MWWorld::LiveCellRef<ESM::Lockpick> *ref = ptr.get<ESM::Lockpick>();
ptr.get<ESM::Lockpick>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -52,7 +52,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)

@ -120,10 +120,9 @@ namespace MWClass
return std::string("Item Misc Down"); return std::string("Item Misc Down");
} }
std::string Miscellaneous::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Miscellaneous::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = const MWWorld::LiveCellRef<ESM::Miscellaneous> *ref = ptr.get<ESM::Miscellaneous>();
ptr.get<ESM::Miscellaneous>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -48,7 +48,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;

@ -97,10 +97,9 @@ namespace MWClass
return std::string("Item Potion Down"); return std::string("Item Potion Down");
} }
std::string Potion::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Potion::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Potion> *ref = const MWWorld::LiveCellRef<ESM::Potion> *ref = ptr.get<ESM::Potion>();
ptr.get<ESM::Potion>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -51,7 +51,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;

@ -102,10 +102,9 @@ namespace MWClass
return std::string("Item Probe Down"); return std::string("Item Probe Down");
} }
std::string Probe::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Probe::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Probe> *ref = const MWWorld::LiveCellRef<ESM::Probe> *ref = ptr.get<ESM::Probe>();
ptr.get<ESM::Probe>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -52,7 +52,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr) virtual boost::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr)

@ -93,10 +93,9 @@ namespace MWClass
return std::string("Item Repair Down"); return std::string("Item Repair Down");
} }
std::string Repair::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Repair::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Repair> *ref = const MWWorld::LiveCellRef<ESM::Repair> *ref = ptr.get<ESM::Repair>();
ptr.get<ESM::Repair>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -48,7 +48,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const; virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;

@ -245,10 +245,9 @@ namespace MWClass
return std::string("Item Misc Down"); return std::string("Item Misc Down");
} }
std::string Weapon::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Weapon::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Weapon> *ref = const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
ptr.get<ESM::Weapon>();
return ref->mBase->mIcon; return ref->mBase->mIcon;
} }

@ -62,7 +62,7 @@ namespace MWClass
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const; virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;

@ -267,7 +267,7 @@ namespace MWWorld
throw std::runtime_error("class does not support soundgen look up"); throw std::runtime_error("class does not support soundgen look up");
} }
std::string Class::getInventoryIcon (const MWWorld::Ptr& ptr) const std::string Class::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
{ {
throw std::runtime_error ("class does not have any inventory icon"); throw std::runtime_error ("class does not have any inventory icon");
} }

@ -248,7 +248,7 @@ namespace MWWorld
virtual float getArmorRating (const MWWorld::Ptr& ptr) const; virtual float getArmorRating (const MWWorld::Ptr& ptr) const;
///< @return combined armor rating of this actor ///< @return combined armor rating of this actor
virtual std::string getInventoryIcon (const MWWorld::Ptr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
///< Return name of inventory icon. ///< Return name of inventory icon.
virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const; virtual std::string getEnchantment (const MWWorld::Ptr& ptr) const;

Loading…
Cancel
Save