OpenMW
|
00001 #ifndef GAME_MWWORLD_REFDATA_H 00002 #define GAME_MWWORLD_REFDATA_H 00003 00004 #include <components/esm/defs.hpp> 00005 00006 #include "../mwscript/locals.hpp" 00007 00008 namespace Ogre 00009 { 00010 class SceneNode; 00011 } 00012 00013 namespace ESM 00014 { 00015 class Script; 00016 class CellRef; 00017 } 00018 00019 namespace MWWorld 00020 { 00021 struct LocalRotation{ 00022 float rot[3]; 00023 }; 00024 00025 class CustomData; 00026 00027 class RefData 00028 { 00029 Ogre::SceneNode* mBaseNode; 00030 00031 00032 MWScript::Locals mLocals; // if we find the overhead of heaving a locals 00033 // object in the refdata of refs without a script, 00034 // we can make this a pointer later. 00035 bool mHasLocals; 00036 bool mEnabled; 00037 int mCount; // 0: deleted 00038 00039 ESM::Position mPosition; 00040 00041 LocalRotation mLocalRotation; 00042 00043 CustomData *mCustomData; 00044 00045 void copy (const RefData& refData); 00046 00047 void cleanup(); 00048 00049 public: 00050 00054 RefData (const ESM::CellRef& cellRef); 00055 00056 RefData (const RefData& refData); 00057 00058 ~RefData(); 00059 00060 RefData& operator= (const RefData& refData); 00061 00063 const std::string &getHandle(); 00064 00066 Ogre::SceneNode* getBaseNode(); 00067 00069 void setBaseNode (Ogre::SceneNode* base); 00070 00071 int getCount() const; 00072 00073 void setLocals (const ESM::Script& script); 00074 00075 void setCount (int count); 00081 00082 MWScript::Locals& getLocals(); 00083 00084 bool isEnabled() const; 00085 00086 void enable(); 00087 00088 void disable(); 00089 00090 ESM::Position& getPosition(); 00091 00092 LocalRotation& getLocalRotation(); 00093 00094 void setCustomData (CustomData *data); 00097 00098 CustomData *getCustomData(); 00100 }; 00101 } 00102 00103 #endif