mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 12:42:11 +00:00
46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
|
|
#include "light.hpp"
|
|
|
|
#include <components/esm/loadligh.hpp>
|
|
|
|
#include <components/esm_store/cell_store.hpp>
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
#include "containerutil.hpp"
|
|
|
|
namespace MWClass
|
|
{
|
|
std::string Light::getName (const MWWorld::Ptr& ptr) const
|
|
{
|
|
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
|
ptr.get<ESM::Light>();
|
|
|
|
if (ref->base->model.empty())
|
|
return "";
|
|
|
|
return ref->base->name;
|
|
}
|
|
|
|
void Light::insertIntoContainer (const MWWorld::Ptr& ptr,
|
|
MWWorld::ContainerStore<MWWorld::RefData>& containerStore) const
|
|
{
|
|
insertIntoContainerStore (ptr, containerStore.lights);
|
|
}
|
|
|
|
std::string Light::getScript (const MWWorld::Ptr& ptr) const
|
|
{
|
|
ESMS::LiveCellRef<ESM::Light, MWWorld::RefData> *ref =
|
|
ptr.get<ESM::Light>();
|
|
|
|
return ref->base->script;
|
|
}
|
|
|
|
void Light::registerSelf()
|
|
{
|
|
boost::shared_ptr<Class> instance (new Light);
|
|
|
|
registerClass (typeid (ESM::Light).name(), instance);
|
|
}
|
|
}
|