30#ifndef MAZEDYNAMICPME_H
31#define MAZEDYNAMICPME_H
34#include "MemoryManager.h"
41class Maze :
public CMemPME
44 Maze(Sint32 iR, Sint32 iC);
46 Sint32 createMaze(vector<Uint8>&);
59 Sint32 final_x, final_w;
60 Sint32 final_y, final_h;
62 bool isRaiseHeightCandidate;
63 bool isShrinkWidthCandidate;
68 bool singleDeadEndDir;
69 bool isEdgeTunnelCandidate;
70 bool isVoidTunnelCandidate;
71 bool isSingleDeadEndCandidate;
72 bool isDoubleDeadEndCandidate;
74 #ifdef DEBUG_GENERATOR
78 vector<stCell> vCells;
82 Sint32 narrowCols[50];
92 Sint32 getRandomInt(Sint32, Sint32);
93 double getRandomReal();
94 Sint32 suffle(vector<stCell*>&);
95 stCell* randomElement(vector<stCell*>&);
101 void getOpenCells(stCell&, Sint32, Sint32, vector<Sint32>&);
102 Sint32 getLeftMostEmptyCells(vector<stCell*>&);
103 bool isOpenCell(stCell& c, Sint32 i, Sint32 prevDir = -1, Sint32 size = -1);
104 void connectCell(stCell&, Sint32);
105 void setResizeCandidates();
106 bool cellIsCrossCenter(stCell&);
107 bool canShrinkWidth(Sint32, Sint32);
108 bool chooseNarrowCols();
109 bool canRaiseHeight(Sint32, Sint32);
110 bool chooseTallRows();
111 bool isHori(Sint32, Sint32);
112 bool isVert(Sint32, Sint32);
114 void setUpScaleCoords();
115 void reassignGroup(Sint32, Sint32);
117 void fillCell(stCell&);
118 void selectSingleDeadEnd(stCell*);
119 void replaceGroup(Sint32, Sint32);
120 bool createTunnels();
124 vector<stCell> tileCells;
125 Sint32 subrows, subcols;
126 Sint32 midcols, fullcols;
127 void setTile(Sint32 x, Sint32 y, Uint8 v, vector<Uint8>&);
128 Sint32 getTile(Sint32, Sint32, vector<Uint8>&);
129 void setTileCell(Sint32, Sint32, stCell&);
130 stCell* getTileCell(Sint32, Sint32);
131 bool getTopEnergizerRange(Sint32&, Sint32&, vector<Uint8>&);
132 bool getBotEnergizerRange(Sint32&, Sint32&, vector<Uint8>&);
133 void eraseUntilIntersection(Sint32, Sint32, vector<Uint8>&);
134 Sint32 generateTiles(vector<Uint8>&);