35#include "MemoryManager.h"
36#include "Pac-Man_Evolution.h"
43#define PME_STATE_NULL 0
44#define PME_STATE_WALL 1
45#define PME_STATE_WALKABLE_GHOST 2
46#define PME_STATE_WALKABLE 4
48#define PME_ITEM_NULL 0
49#define PME_ITEM_PELLET 1
51#define PME_OBJECT_NULL 0
52#define PME_OBJECT_PACMAN 1
53#define PME_OBJECT_GHOST_RED 2
54#define PME_OBJECT_GHOST_PINK 4
55#define PME_OBJECT_GHOST_BLUE 8
56#define PME_OBJECT_GHOST_ORANGE 16
57#define PME_OBJECT_PELLET_POWER1 32
58#define PME_OBJECT_PELLET_POWER2 64
59#define PME_OBJECT_PELLET_POWER3 128
60#define PME_OBJECT_PELLET_POWER4 256
62#define PME_GET_PELLET(x) ((x) & 0x1E0)
64#define PME_ACTOR_ALIVE PME_LOOP
65#define PME_ACTOR_SPECIAL 1
67#define PME_GLOBAL_WAVE_CHASING 1
68#define PME_GLOBAL_WAVE_SCATTERING 2
69#define PME_GLOBAL_WAVE_EVADING 4
70#define PME_GLOBAL_WAVE_EVADING_END 8
72#define RENDERGRAPHICS_START 0
73#define RENDERGRAPHICS_GAME 1
76#define PME_DEBUG_PANEL_GAMEFIELD_X 8
77#define PME_DEBUG_PANEL_GAMEFIELD_Y 0
78#define PME_DEBUG_PANEL_PACMAN_X 8
79#define PME_DEBUG_PANEL_PACMAN_Y 112
80#define PME_DEBUG_PANEL_GHOST_X 8
81#define PME_DEBUG_PANEL_GHOST_Y 224
84class GameField :
public CMemPME
86 friend class EVNTrainer;
88 GameField(GlobalStatus* GS);
94 Sint32 render(Sint32 iMode);
96 MapSearchAStar& mapSearch();
97 Sint32 getState(Sint32 iMX, Sint32 iMY);
98 Sint32 getItem(Sint32 iMX, Sint32 iMY);
99 Sint32 getEatenPelletsPercent();
100 Sint32 getObjectPosition(Sint32, Sint32&, Sint32&);
101 Sint32 getObjectDirection(Sint32, Sint32&, Sint32&);
102 Sint32 getObjectStateName(Sint32,
string&);
103 Sint32 getClosestPellet(Sint32, Sint32&, Sint32&);
104 Sint32 moveTo(Sint32, Sint32, Sint32, Sint32, Sint32);
105 Sint32 messageGetReady(Sint32 iShow);
106 Sint32 initObjects();
107 Sint32 validateMazePosition(Sint32&, Sint32&);
108 Sint32 getMovementOptions(Sint32, Sint32, vector<MazePoint>&);
109 Sint32 getWaveMode();
110 Sint32 setWaveMode(Sint32);
111 Sint32 restoreWaveMode();
121 Sint32 iPreviousMode;
127 Sint32 messageStart();
128 Sint32 messageEnd(Sint32);
129 Sint32 specialText(Font* pFont, Sint32 iX, Sint32 iY,
string &sText, Sint32 iCount);
131 Sint32 addPoints(Sint32 iP);
134 Sint32 iMazeReady, iTimeStart, iGetReadyTime;
135 Sint32 iNumPellets, iNumEatenPellets;
136 Sint32 iMazePixelX, iMazePixelY;
137 template <
typename T> T **create2DArray(Sint32 height, Sint32 width);
138 template <
typename T> Sint32 delete2DArray(T** Array);
146 sField **iFieldArray;
149 vector<Object*> vObjects;
150 Sint32 getObjectIndex(Sint32);
153 Actor* getActor(Sint32);
154 Sint32 getMazeNumber();
157 Sint32 iRenderGraphicsStatus;
158 Sint32 iSpecialTextCounter;
159 string sSpecialMessageCounter;
160 string sSpecialMessage;
165 Sint32 bDebugDisableObjectRender;
166 Sint32 bDebugShowTarget;
167 Sint32 iMazeDynamicGenerationTime;
168 Sint32 iMazeDynamicGenerationAttemps;
172 MapSearchAStar* pMapSearch;
175 GlobalStatus* pGlobalStatus;