Split refdata.hpp in a hpp and a cpp file

Prerequisite for the ContainerStore rewrite, which is a prerequisite for issue #117.
actorid
Marc Zinnschlag 13 years ago
parent 0c2de2c00c
commit 6a88133178

@ -16,7 +16,7 @@ set(GAME_HEADER
source_group(game FILES ${GAME} ${GAME_HEADER})
add_openmw_dir (mwrender
renderingmanager debugging sky player animation npcanimation creatureanimation actors objects renderinginterface
renderingmanager debugging sky player animation npcanimation creatureanimation actors objects renderinginterface
)
add_openmw_dir (mwinput

@ -0,0 +1,88 @@
#include "refdata.hpp"
namespace MWWorld
{
RefData::RefData (const ESMS::CellRef& cellRef)
: mBaseNode(0), mHasLocals (false), mEnabled (true), mCount (1), mPosition (cellRef.pos)
{}
std::string RefData::getHandle()
{
return mBaseNode->getName();
}
Ogre::SceneNode* RefData::getBaseNode()
{
return mBaseNode;
}
void RefData::setBaseNode(Ogre::SceneNode* base)
{
mBaseNode = base;
}
int RefData::getCount() const
{
return mCount;
}
void RefData::setLocals (const ESM::Script& script)
{
if (!mHasLocals)
{
mLocals.configure (script);
mHasLocals = true;
}
}
void RefData::setCount (int count)
{
mCount = count;
}
MWScript::Locals& RefData::getLocals()
{
return mLocals;
}
bool RefData::isEnabled() const
{
return mEnabled;
}
void RefData::enable()
{
mEnabled = true;
}
void RefData::disable()
{
mEnabled = true;
}
boost::shared_ptr<MWMechanics::CreatureStats>& RefData::getCreatureStats()
{
return mCreatureStats;
}
boost::shared_ptr<MWMechanics::NpcStats>& RefData::getNpcStats()
{
return mNpcStats;
}
boost::shared_ptr<MWMechanics::Movement>& RefData::getMovement()
{
return mMovement;
}
boost::shared_ptr<ContainerStore<RefData> >& RefData::getContainerStore()
{
return mContainerStore;
}
ESM::Position& RefData::getPosition()
{
return mPosition;
}
}

@ -5,6 +5,8 @@
#include <boost/shared_ptr.hpp>
#include <Ogre.h>
#include "../mwscript/locals.hpp"
#include "../mwmechanics/creaturestats.hpp"
@ -12,7 +14,6 @@
#include "../mwmechanics/movement.hpp"
#include "containerstore.hpp"
#include <Ogre.h>
namespace ESM
{
@ -45,90 +46,45 @@ namespace MWWorld
ESM::Position mPosition;
public:
/// @param cr Used to copy constant data such as position into this class where it can
/// be altered without effecting the original data. This makes it possible
/// to reset the position as the orignal data is still held in the CellRef
RefData(const ESMS::CellRef& cr) : mBaseNode(0), mHasLocals (false), mEnabled (true),
mCount (1), mPosition(cr.pos) {}
std::string getHandle()
{
return mBaseNode->getName();
}
Ogre::SceneNode* getBaseNode(){
return mBaseNode;
}
void setBaseNode(Ogre::SceneNode* base){
mBaseNode = base;
}
int getCount() const
{
return mCount;
}
void setLocals (const ESM::Script& script)
{
if (!mHasLocals)
{
mLocals.configure (script);
mHasLocals = true;
}
}
void setCount (int count)
{
mCount = count;
}
MWScript::Locals& getLocals()
{
return mLocals;
}
bool isEnabled() const
{
return mEnabled;
}
void enable()
{
mEnabled = true;
}
void disable()
{
mEnabled = true;
}
boost::shared_ptr<MWMechanics::CreatureStats>& getCreatureStats()
{
return mCreatureStats;
}
boost::shared_ptr<MWMechanics::NpcStats>& getNpcStats()
{
return mNpcStats;
}
boost::shared_ptr<MWMechanics::Movement>& getMovement()
{
return mMovement;
}
boost::shared_ptr<ContainerStore<RefData> >& getContainerStore()
{
return mContainerStore;
}
ESM::Position& getPosition()
{
return mPosition;
}
/// @param cellRef Used to copy constant data such as position into this class where it can
/// be altered without effecting the original data. This makes it possible
/// to reset the position as the orignal data is still held in the CellRef
RefData (const ESMS::CellRef& cellRef);
/// Return OGRE handle (may be empty).
std::string getHandle();
/// Return OGRE base node (can be a null pointer).
Ogre::SceneNode* getBaseNode();
/// Set OGRE base node (can be a null pointer).
void setBaseNode (Ogre::SceneNode* base);
int getCount() const;
void setLocals (const ESM::Script& script);
void setCount (int count);
MWScript::Locals& getLocals();
bool isEnabled() const;
void enable();
void disable();
boost::shared_ptr<MWMechanics::CreatureStats>& getCreatureStats();
boost::shared_ptr<MWMechanics::NpcStats>& getNpcStats();
boost::shared_ptr<MWMechanics::Movement>& getMovement();
boost::shared_ptr<ContainerStore<RefData> >& getContainerStore();
ESM::Position& getPosition();
};
}

Loading…
Cancel
Save