2015-11-29 13:13:14 +00:00
|
|
|
#include "customdata.hpp"
|
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <sstream>
|
|
|
|
#include <typeinfo>
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
|
|
|
|
MWClass::CreatureCustomData &CustomData::asCreatureCustomData()
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to CreatureCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-12-19 15:13:00 +00:00
|
|
|
const MWClass::CreatureCustomData &CustomData::asCreatureCustomData() const
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to CreatureCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-11-29 13:13:14 +00:00
|
|
|
MWClass::NpcCustomData &CustomData::asNpcCustomData()
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to NpcCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
const MWClass::NpcCustomData &CustomData::asNpcCustomData() const
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to NpcCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-11-29 13:13:14 +00:00
|
|
|
MWClass::ContainerCustomData &CustomData::asContainerCustomData()
|
2018-12-03 16:21:40 +00:00
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to ContainerCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
|
|
|
const MWClass::ContainerCustomData &CustomData::asContainerCustomData() const
|
2015-11-29 13:13:14 +00:00
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to ContainerCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
|
|
|
MWClass::DoorCustomData &CustomData::asDoorCustomData()
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to DoorCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-12-19 14:57:37 +00:00
|
|
|
const MWClass::DoorCustomData &CustomData::asDoorCustomData() const
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to DoorCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-11-29 13:13:14 +00:00
|
|
|
MWClass::CreatureLevListCustomData &CustomData::asCreatureLevListCustomData()
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to CreatureLevListCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-12-19 15:19:52 +00:00
|
|
|
const MWClass::CreatureLevListCustomData &CustomData::asCreatureLevListCustomData() const
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to CreatureLevListCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-11-29 13:13:14 +00:00
|
|
|
|
|
|
|
}
|