1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#ifndef C_MATCHBLOXENGINE_HEADER_FILE
#define C_MATCHBLOXENGINE_HEADER_FILE
#include "MessageQueue.h"
class C_3DObject;
class C_Block;
class C_Hand;
class C_Log;
class C_Environment;
class C_Box;
typedef enum GameResult
{
GR_FINISHED,
GR_BUSY,
GR_ERROR
} GameResult;
enum EngineState
{
ES_INITIALISED,
ES_ERROR,
ES_GET_READY, //game initialised, waiting for start signal from player
ES_PLAYING_GRAB_BLOCK, //no block in hand -> grab floating block
ES_PLAYING_PUT_BLOCK, //block in hand -> put block in box
ES_PAUSED, //pause...
ES_FINISHED //finished -> show score and goto init
};
enum BlockType
{
BT_SQUARE = 0,
BT_CIRCLE = 1,
BT_TRIANGLE = 2,
BT_CROSS = 3
};
enum BoxSize
{
BS_SMALL = 0,
BS_MED = 1,
BS_LARGE = 2
};
class C_MatchBloxEngine
{
public:
C_MatchBloxEngine(const char *f_strModelPath,
const char *f_strLogFile);
~C_MatchBloxEngine();
GameResult GameStep(msgQueue &f_Queue);
void Render(unsigned int f_uiElapsedTime);
bool NewGame(int f_iUserID, int f_iGameId, BoxSize f_BS);
bool StartGame();
bool Pause();
bool Resume();
bool Abort();
private:
C_Environment *m_pEnvMap;
C_Block *m_pBlock[4];
C_Hand *m_pHand;
C_3DObject *m_pTiles[5];
C_Box *m_pBox[3];
C_Log *m_pLog;
GLuint m_uiWood1Tex,
m_uiWood2Tex,
m_uiWood3Tex;
EngineState m_State, m_SavedState;
BoxSize m_CurrentBox;
void Render_Basics(unsigned int f_uiElapsedTime);
bool LoadModels(const char* f_strModelDir);
void DeleteModels();
void LoadTexture(const char* f_BmpName, GLuint &f_uiTexHandle);
};
#endif //C_MATCHBLOXENGINE_HEADER_FILE
|