📄 rpgprocess.h
字号:
//RPGProcess.h
/*/////////////////////////////////////////////////////////////////
李亦
liease@163.com 4040719
2006-7-17
/*/////////////////////////////////////////////////////////////////
#ifndef _RPGPROCESS_H_
#define _RPGPROCESS_H_
#ifndef _RPG__RPGBASE_H_
#include "rpg/gobjects/RPGBase.h"
#endif
class NetConnection;
struct Move;
class GameConnection;
namespace RPG
{
//-----------------------------------------------------------------------------
enum ETickConstants
{
//TICK_LEN_SEC = ((F32)(TICK_LEN_MS) / 1000.0f)
};
#define TICK_SHIFT 5
#define TICK_LEN_MS (1 << TICK_SHIFT)
#define TICK_MASK (TICK_LEN_MS - 1)
#define TICK_LEN_SEC (F32(TICK_LEN_MS) / 1000.0f)
/// List to keep track of RPGBases to process.
class RPGProcess
{
RPGBase m_listHeader;
U32 m_dwSequence;
SimTime m_dwLastTick;
SimTime m_dwLastTime;
SimTime m_dwLastDelta;
//bool mIsServer;
bool m_bDirty;
//static bool mDebugControlSync;
void orderList();
void advanceObjects();
public:
RPGProcess();
SimTime getLastTime () { return m_dwLastTime; }
void markDirty () { m_bDirty = true; }
bool isDirty () { return m_bDirty; }
void addObject (RPGBase* obj) { obj->PLLinkBefore(&m_listHeader); }
F32 getLastInterpDelta () { return m_dwLastDelta / F32(TICK_LEN_MS); }
/// @name Advancing Time
/// The advance time functions return true if a tick was processed.
///
/// These functions go through either gServerProcessList or gClientProcessList and
/// call each RPGBase's ProcessTick().
/// @{
//bool advanceServerTime(SimTime timeDelta);
//bool advanceClientTime(SimTime timeDelta);
bool AdvanceTime(SimTime timeDelta);
/// @}
};
extern RPGProcess g_RPGProcess;
};//namespace RPG
#endif //_RPGPROCESS_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -