1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

Accept a ConstPtr in get*SoundId

This commit is contained in:
scrawl 2015-12-18 16:09:08 +01:00
parent dc92fefd2b
commit d77f785cbc
26 changed files with 56 additions and 60 deletions

View file

@ -82,12 +82,12 @@ namespace MWClass
registerClass (typeid (ESM::Apparatus).name(), instance); registerClass (typeid (ESM::Apparatus).name(), instance);
} }
std::string Apparatus::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Apparatus::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Apparatus Up"); return std::string("Item Apparatus Up");
} }
std::string Apparatus::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Apparatus::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Apparatus Down"); return std::string("Item Apparatus Down");
} }

View file

@ -45,10 +45,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -177,7 +177,7 @@ namespace MWClass
registerClass (typeid (ESM::Armor).name(), instance); registerClass (typeid (ESM::Armor).name(), instance);
} }
std::string Armor::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Armor::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
int es = getEquipmentSkill(ptr); int es = getEquipmentSkill(ptr);
if (es == ESM::Skill::LightArmor) if (es == ESM::Skill::LightArmor)
@ -188,7 +188,7 @@ namespace MWClass
return std::string("Item Armor Heavy Up"); return std::string("Item Armor Heavy Up");
} }
std::string Armor::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Armor::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
int es = getEquipmentSkill(ptr); int es = getEquipmentSkill(ptr);
if (es == ESM::Skill::LightArmor) if (es == ESM::Skill::LightArmor)

View file

@ -58,10 +58,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -96,12 +96,12 @@ namespace MWClass
registerClass (typeid (ESM::Book).name(), instance); registerClass (typeid (ESM::Book).name(), instance);
} }
std::string Book::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Book::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Book Up"); return std::string("Item Book Up");
} }
std::string Book::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Book::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Book Down"); return std::string("Item Book Down");
} }

View file

@ -42,10 +42,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -133,10 +133,9 @@ namespace MWClass
registerClass (typeid (ESM::Clothing).name(), instance); registerClass (typeid (ESM::Clothing).name(), instance);
} }
std::string Clothing::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Clothing::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Clothing> *ref = const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
ptr.get<ESM::Clothing>();
if (ref->mBase->mData.mType == 8) if (ref->mBase->mData.mType == 8)
{ {
@ -145,10 +144,9 @@ namespace MWClass
return std::string("Item Clothes Up"); return std::string("Item Clothes Up");
} }
std::string Clothing::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Clothing::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Clothing> *ref = const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
ptr.get<ESM::Clothing>();
if (ref->mBase->mData.mType == 8) if (ref->mBase->mData.mType == 8)
{ {

View file

@ -50,10 +50,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -98,12 +98,12 @@ namespace MWClass
registerClass (typeid (ESM::Ingredient).name(), instance); registerClass (typeid (ESM::Ingredient).name(), instance);
} }
std::string Ingredient::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Ingredient::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Ingredient Up"); return std::string("Item Ingredient Up");
} }
std::string Ingredient::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Ingredient::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Ingredient Down"); return std::string("Item Ingredient Down");
} }

View file

@ -46,10 +46,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -126,12 +126,12 @@ namespace MWClass
registerClass (typeid (ESM::Light).name(), instance); registerClass (typeid (ESM::Light).name(), instance);
} }
std::string Light::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Light::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Misc Up"); return std::string("Item Misc Up");
} }
std::string Light::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Light::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Misc Down"); return std::string("Item Misc Down");
} }

View file

@ -46,10 +46,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -92,12 +92,12 @@ namespace MWClass
registerClass (typeid (ESM::Lockpick).name(), instance); registerClass (typeid (ESM::Lockpick).name(), instance);
} }
std::string Lockpick::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Lockpick::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Lockpick Up"); return std::string("Item Lockpick Up");
} }
std::string Lockpick::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Lockpick::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Lockpick Down"); return std::string("Item Lockpick Down");
} }

View file

@ -46,10 +46,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -106,14 +106,14 @@ namespace MWClass
registerClass (typeid (ESM::Miscellaneous).name(), instance); registerClass (typeid (ESM::Miscellaneous).name(), instance);
} }
std::string Miscellaneous::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Miscellaneous::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
if (isGold(ptr)) if (isGold(ptr))
return std::string("Item Gold Up"); return std::string("Item Gold Up");
return std::string("Item Misc Up"); return std::string("Item Misc Up");
} }
std::string Miscellaneous::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Miscellaneous::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
if (isGold(ptr)) if (isGold(ptr))
return std::string("Item Gold Down"); return std::string("Item Gold Down");

View file

@ -42,10 +42,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -87,12 +87,12 @@ namespace MWClass
registerClass (typeid (ESM::Potion).name(), instance); registerClass (typeid (ESM::Potion).name(), instance);
} }
std::string Potion::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Potion::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Potion Up"); return std::string("Item Potion Up");
} }
std::string Potion::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Potion::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Potion Down"); return std::string("Item Potion Down");
} }

View file

@ -45,10 +45,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -92,12 +92,12 @@ namespace MWClass
registerClass (typeid (ESM::Probe).name(), instance); registerClass (typeid (ESM::Probe).name(), instance);
} }
std::string Probe::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Probe::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Probe Up"); return std::string("Item Probe Up");
} }
std::string Probe::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Probe::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Probe Down"); return std::string("Item Probe Down");
} }

View file

@ -46,10 +46,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -83,12 +83,12 @@ namespace MWClass
registerClass (typeid (ESM::Repair).name(), instance); registerClass (typeid (ESM::Repair).name(), instance);
} }
std::string Repair::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Repair::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Repair Up"); return std::string("Item Repair Up");
} }
std::string Repair::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Repair::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
return std::string("Item Repair Down"); return std::string("Item Repair Down");
} }

View file

@ -42,10 +42,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -153,10 +153,9 @@ namespace MWClass
registerClass (typeid (ESM::Weapon).name(), instance); registerClass (typeid (ESM::Weapon).name(), instance);
} }
std::string Weapon::getUpSoundId (const MWWorld::Ptr& ptr) const std::string Weapon::getUpSoundId (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Weapon> *ref = const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
ptr.get<ESM::Weapon>();
int type = ref->mBase->mData.mType; int type = ref->mBase->mData.mType;
// Ammo // Ammo
@ -198,10 +197,9 @@ namespace MWClass
return std::string("Item Misc Up"); return std::string("Item Misc Up");
} }
std::string Weapon::getDownSoundId (const MWWorld::Ptr& ptr) const std::string Weapon::getDownSoundId (const MWWorld::ConstPtr& ptr) const
{ {
MWWorld::LiveCellRef<ESM::Weapon> *ref = const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
ptr.get<ESM::Weapon>();
int type = ref->mBase->mData.mType; int type = ref->mBase->mData.mType;
// Ammo // Ammo

View file

@ -56,10 +56,10 @@ namespace MWClass
static void registerSelf(); static void registerSelf();
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the pick up sound Id ///< Return the pick up sound Id
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const; virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
///< Return the put down sound Id ///< Return the put down sound Id
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const; virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;

View file

@ -252,12 +252,12 @@ namespace MWWorld
sClasses.insert(std::make_pair(key, instance)); sClasses.insert(std::make_pair(key, instance));
} }
std::string Class::getUpSoundId (const Ptr& ptr) const std::string Class::getUpSoundId (const ConstPtr& ptr) const
{ {
throw std::runtime_error ("class does not have an up sound"); throw std::runtime_error ("class does not have an up sound");
} }
std::string Class::getDownSoundId (const Ptr& ptr) const std::string Class::getDownSoundId (const ConstPtr& ptr) const
{ {
throw std::runtime_error ("class does not have an down sound"); throw std::runtime_error ("class does not have an down sound");
} }

View file

@ -234,11 +234,11 @@ namespace MWWorld
/// ///
/// (default implementation: return false) /// (default implementation: return false)
virtual std::string getUpSoundId (const Ptr& ptr) const; virtual std::string getUpSoundId (const ConstPtr& ptr) const;
///< Return the up sound ID of \a ptr or throw an exception, if class does not support ID retrieval ///< Return the up sound ID of \a ptr or throw an exception, if class does not support ID retrieval
/// (default implementation: throw an exception) /// (default implementation: throw an exception)
virtual std::string getDownSoundId (const Ptr& ptr) const; virtual std::string getDownSoundId (const ConstPtr& ptr) const;
///< Return the down sound ID of \a ptr or throw an exception, if class does not support ID retrieval ///< Return the down sound ID of \a ptr or throw an exception, if class does not support ID retrieval
/// (default implementation: throw an exception) /// (default implementation: throw an exception)