1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:19:54 +00:00
openmw-tes3mp/apps/openmw/mwclass/clothing.cpp
2010-08-06 22:20:20 +02:00

42 lines
1,018 B
C++

#include "clothing.hpp"
#include <components/esm/loadclot.hpp>
#include <components/esm_store/cell_store.hpp>
#include "../mwworld/ptr.hpp"
#include "containerutil.hpp"
namespace MWClass
{
std::string Clothing::getName (const MWWorld::Ptr& ptr) const
{
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
ptr.get<ESM::Clothing>();
return ref->base->name;
}
void Clothing::insertIntoContainer (const MWWorld::Ptr& ptr,
MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
{
insertIntoContainerStore (ptr, containerStore.clothes);
}
std::string Clothing::getScript (const MWWorld::Ptr& ptr) const
{
ESMS::LiveCellRef<ESM::Clothing, MWWorld::RefData> *ref =
ptr.get<ESM::Clothing>();
return ref->base->script;
}
void Clothing::registerSelf()
{
boost::shared_ptr<Class> instance (new Clothing);
registerClass (typeid (ESM::Clothing).name(), instance);
}
}