2015-11-29 14:13:14 +01:00
|
|
|
#include "customdata.hpp"
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
#include <stdexcept>
|
|
|
|
#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 16:13:00 +01: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 14:13:14 +01: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 15:27:06 +01: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 14:13:14 +01:00
|
|
|
MWClass::ContainerCustomData& CustomData::asContainerCustomData()
|
2018-12-03 20:21:40 +04: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 14:13:14 +01: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 15:57:37 +01: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-12-19 16:19:52 +01:00
|
|
|
MWClass::CreatureLevListCustomData& CustomData::asCreatureLevListCustomData()
|
|
|
|
{
|
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to CreatureLevListCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
|
|
|
}
|
|
|
|
|
2015-11-29 14:13:14 +01:00
|
|
|
const MWClass::CreatureLevListCustomData& CustomData::asCreatureLevListCustomData() const
|
2022-09-22 21:26:05 +03:00
|
|
|
{
|
2015-11-29 14:13:14 +01:00
|
|
|
std::stringstream error;
|
|
|
|
error << "bad cast " << typeid(this).name() << " to CreatureLevListCustomData";
|
|
|
|
throw std::logic_error(error.str());
|
2022-09-22 21:26:05 +03:00
|
|
|
}
|
2015-11-29 14:13:14 +01:00
|
|
|
|
|
|
|
}
|