#include "container.hpp" #include #include #include "../mwworld/ptr.hpp" namespace MWClass { std::string Container::getName (const MWWorld::Ptr& ptr) const { ESMS::LiveCellRef *ref = ptr.get(); return ref->base->name; } MWWorld::ContainerStore& Container::getContainerStore (const MWWorld::Ptr& ptr) const { if (!ptr.getRefData().getContainerStore().get()) { boost::shared_ptr > store ( new MWWorld::ContainerStore); // TODO add initial content ptr.getRefData().getContainerStore() = store; } return *ptr.getRefData().getContainerStore(); } std::string Container::getScript (const MWWorld::Ptr& ptr) const { ESMS::LiveCellRef *ref = ptr.get(); return ref->base->script; } void Container::registerSelf() { boost::shared_ptr instance (new Container); registerClass (typeid (ESM::Container).name(), instance); } }