📄 gscene.h
字号:
//GScene.h
/*/////////////////////////////////////////////////////////////////
李亦
liease@163.com 4040719
2006-7-14
/*/////////////////////////////////////////////////////////////////
#ifndef _RPG__GSCENE_H_
#define _RPG__GSCENE_H_
#ifndef _RPG__RPGDEFINE_H_
#include "rpg/RPGDefine.h"
#endif
#ifndef _RPG__GOBJECTDEFINE_H_
#include "GObjectDefine.h"
#endif
#ifndef _RPG__RPGBASE_H_
#include "RPGBase.h"
#endif
namespace RPG
{
class GNpc;
class GPlayer;
#define DECLARE_SCENE_MEMBER(Name)\
Vector<G##Name*> m_ar##Name##s;\
inline U32 Add##Name (G##Name* pGObject)\
{ m_ar##Name##s.push_back(pGObject); return m_ar##Name##s.size()-1;}
///////////////////////////////////////////
typedef struct tagGScene //: public tagGCharacter
{
StringTableEntry pIDName;
StringTableEntry pName;
EGSceneStates dwState;
EGSceneTypes dwType;
StringTableEntry pDesc;
}GSCENE;
///////////////////////////////////////////
//场景数据管理
class GScene : public RPGBase
{
typedef RPGBase Parent;
friend class RPGDatabase;
protected:
GSCENE m_dataScene;
//Vector<GNpc*> m_arNpcs;
//Vector<GPlayer*> m_arPlayers;
public:
public:
enum EGSceneMasks
{
//InitialUpdateMask = 1,//Parent::NextFreeMask,
};
public:
//构造/析构函数
GScene();
virtual ~GScene();
public:
void ClearData(U32 dwState);
public:
DECLARE_SCENE_MEMBER(Npc);
DECLARE_SCENE_MEMBER(Player);
inline StringTableEntry GetIDName() {return m_dataScene.pIDName;}
inline StringTableEntry GetSceneName() {return m_dataScene.pName;}
inline StringTableEntry GetSceneDesc() {return m_dataScene.pDesc;}
StringTableEntry GetTypeName();
//StringTableEntry GetStateName();
#ifdef TGE_RPGCLIENT
public:
void CreateSubObjects(CSTR sClass, CSTR sClassAI);
void UpdateAllTaskNpc(GPlayer* pGPlayer);
#endif
public:
//bool OnNewDataBlock(RPGBaseData* dptr);
//bool OnNewGameBase(GameBase* dptr);
void ProcessTick(const Move *move);
void InterpolateTick(F32 delta);
void AdvanceTime(F32 dt);
void PreprocessMove(Move *move) {}
U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream);
void unpackUpdate(NetConnection *conn, BitStream *stream);
//bool onAdd();
//void onRemove();
//void inspectPostApply();
static void initPersistFields();
//static void consoleInit();
public:
DECLARE_CONOBJECT(GScene);
};//GScene
extern GScene* g_pGScene;
////////////////////////////////////////////////////////////
inline StringTableEntry GScene::GetTypeName()
{
if(g_pRPGSetting)
return g_pRPGSetting->GetSceneTypeName(m_dataScene.dwType);
return StringTable->getBlank();
}
};//namespace RPG
#endif //_RPG__GSCENE_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -