aigenerator.h
来自「Visual C++ 游戏开发与设计实例 源代码(所有)」· C头文件 代码 · 共 62 行
H
62 行
#ifndef _AIGENERATOR_H
#define _AIGENERATOR_H
#include "object.h"
#define DEFMAXPROB 60
#define DEFTRACKSCOPE 80
struct AIGEN_AIM {
int prob;
};
//-----------------------------------------------------------------------------
// Name: class CAiGenerator
// Desc: Class to create a common used AI generator
//-----------------------------------------------------------------------------
class CAiGenerator {
int CmdProbs[6];
RECT m_rtAvoid[5];
CMobileObject *m_pAim;
int m_nAimProb;
int m_nTrackProb;
int m_nMaxProb;
int m_nCurrentProb;
int m_nFireMaxProb;
int m_nFireProb;
bool m_bLastBlock;
RECT m_LastPos;
TANKCMD m_LastCmd;
CMobileObject **m_LastAim;
RECT m_rtScope;
CObjTank *m_pHost;
public:
CAiGenerator();
~CAiGenerator();
// Status functions
RECT GetScope() { return m_rtScope; }
void SetScope( RECT s) { m_rtScope = s; }
// Access functions
void SetAvoid ( RECT rt );
void SetAim( CMobileObject *pmo, int prob );
// Creation/destruction methods
bool CreateGenerator( CObjTank *ptk, RECT scope );
// Methods
TANKCMD Generator( CMobileObject **ppmos, int num );
};
#endif // _AIGENERATOR_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?