-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapClasses.ixx
727 lines (609 loc) · 20.3 KB
/
MapClasses.ixx
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
/**
*
* __ __
* | \/ | __ _ _ __
* | |\/| |/ _` | '_ \
* | | | | (_| | |_) |
* |_|__|_|\__,_| .__/
* / ___| | __ |_|__ ___ ___ ___
* | | | |/ _` / __/ __|/ _ \/ __|
* | |___| | (_| \__ \__ \ __/\__ \
* \____|_|\__,_|___/___/\___||___/
*
*
* The MAP class, and the BLOCK class whose objects that compose the map.
*
*/
module;
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_ttf.h"
export module MapClasses;
import <stdio.h>;
import <string>;
import <iostream>;
import <vector>;
import <cstdlib>;
import <time.h>;
import <unordered_map>;
import FormFactory;
import TypeStorage;
import GameState;
import Resources;
import CharacterClasses;
import LimbFormMasterList;
import UI;
using namespace std;
export enum MapDirection { Up, Down, Left, Right, Total }; /* NOT a CLASS because we want to use it as int. */
/* This is what a Landmark's checkCollision function will return. */
export struct LandmarkCollisionInfo {
bool hasCollided;
int subject;
LandmarkType type;
/* constructor */
LandmarkCollisionInfo(bool iHasCollided, LandmarkType iType, int iSubject) :
hasCollided(iHasCollided), subject(iSubject), type(iType) {
}
};
/*
* SubPath helps draw paths of floors through the blockmap.
* Create smaller sub-paths so we aren't moving around totally randomly.
*/
export struct SubPath {
int seed;
MapDirection direction;
int radius;
SubPath(int iSeed, MapDirection iDirection, int iRadius) {
direction = iDirection;
seed = iSeed;
radius = iRadius;
}
};
/*
* Character will eventually go in its own module, along with Limb, for use in Character Creation and Battle screens.
* Some of the attributes are specific to the Map Screen. So we will have a Character Decorator in the Map Screen
* which will add the map-related members and functions to the extended object.
* Battle and Character Creation screens will have their own decorators, adding their own stuff.
*/
export class MapCharacter : public Character {
public:
MapCharacter(CharacterType characterType = CharacterType::None) : Character(characterType) {}
/* There will be no texture. The character will be drawn from their limbs. */
MapCharacter(CharacterType characterType, int x, int y) :
Character(characterType), blockPosition(x, y), lastBlockPosition(x, y) {
}
~MapCharacter() {}
int getBlockX() { return blockPosition.x; }
int getBlockY() { return blockPosition.y; }
int getLastX() { return lastBlockPosition.x; }
int getLastY() { return lastBlockPosition.y; }
Point getPosition() { return blockPosition; }
Point getLastPosition() { return lastBlockPosition; }
void setBlockPosition(Point blockPosition) {
this->blockPosition = blockPosition;
}
SDL_Texture* getTexture() { return texture; } /* This must move to the parent class. */
void setTexture(SDL_Texture* incomingTexture) {
if (texture) {
cout << "Already texture\n";
SDL_DestroyTexture(texture);
}
texture = incomingTexture;
}
void updateLastBlock() {
lastBlockPosition.x = blockPosition.x;
lastBlockPosition.y = blockPosition.y;
}
bool move(MapDirection direction, int distance = 1) {
bool moved = false;
/* This will become more complicated when we do animations. */
/* Checking for obstacles must be done by MapScreen object.
* When this is called, we follow blindly. */
switch (direction) {
case MapDirection::Up:
updateLastBlock();
blockPosition.y -= distance;
moved = true;
break;
case MapDirection::Down:
updateLastBlock();
blockPosition.y += distance;
moved = true;
break;
case MapDirection::Left:
updateLastBlock();
blockPosition.x -= distance;
moved = true;
break;
case MapDirection::Right:
updateLastBlock();
blockPosition.x += distance;
moved = true;
break;
}
// cout << blockPosition.x << ", " << blockPosition.y << "\n";
return moved;
}
private:
Point blockPosition; /* This can be saved in the MAP table, so we always return. No need to save it in the Character table. */
Point lastBlockPosition;
SDL_Texture* texture;
};
/*
* How do we add FUNCTIONS to the Landmark objects?
* This may be where we need lambdas
* [](){}
* [variables brought in from parent scope](parameters called at runtime){ logic which possibly returns something }
*
* OR do we let MapScreen handle that, and just let the Landmark class detect collisions?
*
*/
export class Landmark {
public:
/* constructor (primarily for entrance and exit.) */
Landmark(
Point position,
SDL_Texture* texture,
LandmarkType landmarkType,
int subjectId,
string slug
) :
texture(texture),
landmarkType(landmarkType),
subjectId(subjectId),
position(position),
slug(slug)
{ }
/* destructor */
~Landmark() { /* Texture is managed by MapScreen and will be destroyed at the end of the run() function. */ }
int getDrawX() { return position.x; }
int getDrawY() { return position.y; }
Point getPosition() { return position; }
void setSlug(string slug) { this->slug = slug; }
string getSlug() { return slug; }
LandmarkType getType() { return landmarkType; }
int getId() { return id; }
void setId(int id) { this->id = id; }
SDL_Texture* getTexture() { return texture; }
LandmarkCollisionInfo checkCollision(Point pos) { return checkCollision(pos.x, pos.y); }
LandmarkCollisionInfo checkCollision(int x, int y) {
if (x == position.x && y == position.y) {
return { true, landmarkType, subjectId };
}
return { false, landmarkType, -1 }; }
private:
/* Point refers to the block grid, not the pixels */
int id;
string slug;
Point position;
SDL_Texture* texture;
LandmarkType landmarkType;
int subjectId; /* This can be either the MAP id or the SUIT slug??? Needs re-thinking! */
};
export Landmark getExitLandmark(Point position) {
UI& ui = UI::getInstance();
SDL_Surface* gateSurface = IMG_Load("assets/ENTRANCE.png");
SDL_Texture* gateTexture = SDL_CreateTextureFromSurface(ui.getMainRenderer(), gateSurface);
SDL_FreeSurface(gateSurface);
string slug = "exit";
return Landmark(position, gateTexture, LandmarkType::Exit, -1, slug);
}
export Landmark getEntranceLandmark(Point position) {
UI& ui = UI::getInstance();
SDL_Surface* gateSurface = IMG_Load("assets/ENTRANCE.png");
SDL_Texture* gateTexture = SDL_CreateTextureFromSurface(ui.getMainRenderer(), gateSurface);
SDL_FreeSurface(gateSurface);
string slug = "entrance";
return Landmark(position, gateTexture, LandmarkType::Entrance, -1, slug);
}
export class Block {
public:
/* constructor */
Block(bool isFloor = true)
: isFloor(isFloor), floorTextureIndex(0), isPath(false), pathFlipOption(0), pathRotateAngle(0), wallTextureIndex(0), pathTextureIndex(0) {
loaded = false;
}
/* Rebuilding block from DB. */
Block(int id, bool isFloor, bool isPath, bool isLooted) :
id(id), isFloor(isFloor), isPath(isPath), isLooted(isLooted)
{
floorTextureIndex = 0;
pathFlipOption = 0;
wallTextureIndex = 0;
pathTextureIndex = 0;
pathRotateAngle = 0;
loaded = true;
}
/* getters */
bool getIsFloor() { return isFloor; }
bool getIsLooted() { return isLooted; }
bool getIsLoaded() { return loaded; }
int getFloorTextureIndex() { return floorTextureIndex; }
void setFloorTextureIndex(int index) { floorTextureIndex = index; }
int getWallTextureIndex() { return wallTextureIndex; }
bool getWallIsFlipped() { return wallIsFlipped; }
bool getIsPath() { return isPath; }
int getPathFlipOption() { return pathFlipOption; }
int getPathRotateAngle() { return pathRotateAngle; }
int getPathTextureIndex() { return pathTextureIndex; }
int getId() { return id; }
/* setters */
void setPathRotateAngle(int angle = 0) { pathRotateAngle = angle; }
void setPathFlipOption(int option = 0) { pathFlipOption = option; }
void setIsFloor(bool incomingIsFloor) { isFloor = incomingIsFloor; }
void setIsPath(bool incomingIsPath = true) { isPath = incomingIsPath; }
void setWallTextureIndex(int index) { wallTextureIndex = index; }
void setWallIsFlipped(bool flipWall) { wallIsFlipped = flipWall; }
void setPathTextureIndex(int index) { pathTextureIndex = index; }
void setId(int id) { this->id = id; }
void loot() {
isLooted = true;
/*
* When we have LIMB objects (imported from a different module)
* this will return a vector of Limb objects.
*
* Also... maybe it won't return it... because you can destroy a wall from afar
* and the Limb objects will scatter nearby.
*
* Maybe we need an isPath boolean, to draw a different kind of floor.
*/
}
private:
bool isFloor;
bool isLooted;
bool isPath;
int pathFlipOption;
int pathRotateAngle;
int floorTextureIndex;
int wallTextureIndex;
int pathTextureIndex;
bool wallIsFlipped;
int id;
bool loaded = false;
};
/* The Map object contains all the blocks from the DB. */
export class Map {
public:
/* constructors */
Map() {};
Map(MapForm mapForm);
Map(MapForm mapForm, vector<Limb> roamingLimbs, vector<vector<Block>> rows, Point characterPosition);
vector<vector<Block>>& getRows() { return rows; }
vector<Landmark>& getLandmarks() { return landmarks; }
MapCharacter& getPlayerCharacter() { return playerCharacter; }
SDL_Texture* getFloorTexture(int index) { return mapForm.floorTextures[index]; }
SDL_Texture* getWallTexture(int index) { return mapForm.wallTextures[index]; }
SDL_Texture* getPathTexture(int index) { return mapForm.pathTextures[index]; }
vector<Limb>& getRoamingLimbs() { return roamingLimbs; }
string getName() { return mapForm.name; }
string getSlug() { return mapForm.slug; }
MapLevel getMapLevel() { return mapForm.mapLevel; }
void setLandmarks(vector<Landmark> landmarks) { this->landmarks = landmarks; }
void setPlayerCharacter(MapCharacter playerCharacter) { this->playerCharacter = playerCharacter; }
MapForm getForm() { return mapForm; }
void randomizePathOptions(Block& block);
private:
MapForm mapForm;
vector<vector<Block>> rows;
void floorize(int x, int y, int radius);
vector<Point> buildMap(MapForm mapForm);
vector<MapCharacter> NPCs;
MapCharacter playerCharacter;
/* stuff sent in from MapData struct */
vector<Landmark> landmarks;
vector<LimbForm> nativeLimbForms;
vector<Limb> roamingLimbs;
/* Will need a list of NPCs */
/* Will need a list of Roaming Limbs */
/* Will need classes for both NPC and RoamingLimb (probably?) */
};
/*
*
*
*
*
*
*
*
* Map Functions
*
*
*
*
*
*
*
*/
/* Map class constructor for brand new map. */
Map::Map(MapForm mapForm) : mapForm(mapForm) {
/*
* Currently we create a new map every time we load the Map Screen.
* It is built on a half-complete definition of Map structs.
* We still need Suits for Shrines, and other landmarks.
* Then we will need to save the built maps into the database, so we can load instead of building fresh next time.
*/
/*
* On the first draw, we must build the GRID based on the number of SUITS (therefore shrines) and landmarks.
* But we must scatter the LIMBS across the available FLOOR tiles, which are only known after creating the grid.
* So SUITS must be calculated before buildMap, and Limbs must be created and distributed AFTER buildMap.
*
* After incorporating the database, we will need to differentiate between FIRST TIME (create map) vs. rebuilding
* from the DB.
*/
/* Build the actual grid for the first time. Receive a list of floor coordinates. */
vector<Point> floorPositions = buildMap(mapForm);
/* populate characters and limbs after building the map(and its landmarks). */
nativeLimbForms = getMapLimbs(mapForm.mapLevel);
/* FOR NOW I just have ONE copy of each native limb */
for (LimbForm& limbForm : nativeLimbForms) {
int numberOfThisLimb = (rand() % 15) + 5;
for (int n = 0; n < numberOfThisLimb; ++n) {
Limb& newLimb = roamingLimbs.emplace_back(limbForm);
Point newPosition = floorPositions[rand() % floorPositions.size()];
newLimb.setPosition(newPosition);
newLimb.setLastPosition(newPosition);
}
}
cout << "\n\nThere are " << roamingLimbs.size() << " LIMBS in Roaming Limbs\n\n";
}
/* Map class constructor to rebuild map from DB data.
* TO DO:
* -----> Add Landmarks
* -----> Add NPCs
*/
Map::Map(MapForm mapForm, vector<Limb> roamingLimbs, vector<vector<Block>> rows, Point characterPosition) :
mapForm(mapForm), roamingLimbs(roamingLimbs), rows(rows) {
/* populate characters and limbs after building the map(and its landmarks). */
nativeLimbForms = getMapLimbs(mapForm.mapLevel);
UI& ui = UI::getInstance();
/* create Player Character */
/* get character texture */
SDL_Surface* characterSurface = IMG_Load("assets/player_character.png");
SDL_Texture* characterTexture = SDL_CreateTextureFromSurface(ui.getMainRenderer(), characterSurface);
SDL_FreeSurface(characterSurface);
/*
* PROBLEM
*
* How can I load from the database when the database imports this module?
*
* SOLUTION:
* Map constructor must take pre-built Character object in constructor.
* The Screen will create the character object (or maybe the Database will).
*
*/
playerCharacter = MapCharacter(CharacterType::Player, characterPosition.x, characterPosition.y);
playerCharacter.setTexture(characterTexture);
/* Set wall and floor texture indexes. */
for (int i = 0; i < this->rows.size(); ++i) {
vector<Block>& blocks = this->rows[i];
for (int k = 0; k < blocks.size(); ++k) {
Block& thisBlock = blocks[k];
thisBlock.setFloorTextureIndex(rand() % mapForm.floorTextures.size());
/* set texture values for Wall blocks (defaults if they're not wall blocks). */
if (thisBlock.getIsFloor()) {
thisBlock.setWallTextureIndex(rand() % mapForm.floorTextures.size());
thisBlock.setWallIsFlipped(rand() % 2 == 0);
if (thisBlock.getIsPath()) {
randomizePathOptions(thisBlock);
}
}
else {
thisBlock.setWallTextureIndex(rand() % mapForm.wallTextures.size());
thisBlock.setWallIsFlipped(rand() % 2 == 0);
}
}
}
}
/*
* Build the actual grid of Block objects.
* Returns a vector of Points which are the coordinates for all Floor objects.
* The Floor Points are used to populate the map with Roaming Limbs.
*/
vector<Point> Map::buildMap(MapForm mapForm) {
/*
* This WILL get the DB object and build the entire map as data.
* To draw the map will mean to review this data and draw the local blocks.
* For now just make a checkerboard grid of blocks.
*
* Might not be a member of the MapScreen object.
* Might instead be a member of the Map object.
*
*
* DEVELOPMENT STAGES:
* 1. Build a map with ALL WALLS
* 2. Draw a PATH through those walls
* 3. Navigate around the map with arrows (no character)
* 4. Put a "character" (struct) in the map and navigate around like a maze
* 5. When you reach the other end you go back to the other screen
* 6. Save the generated screen to a database.
* 7. Read map paramaters from a JSON
* 8. Delete map entirely from database
*/
UI& ui = UI::getInstance();
rows = vector<vector<Block>>(mapForm.blocksHeight);
/* replace with reading from DB */
for (int i = 0; i < rows.size(); ++i) {
vector<Block> blocks(mapForm.blocksWidth);
for (int k = 0; k < blocks.size(); ++k) {
blocks[k] = Block(false);
}
rows[i] = blocks;
}
/* Now make the PATH */
/* get a random x starting point, but the y will be map's height - 2 */
int pathX = (rand() % (mapForm.blocksWidth - 10)) + 5;
int pathY = static_cast<int>(rows.size()) - 2;
int playerX = pathX;
int playerY = pathY;
Block& startingBlock = rows[pathY][pathX];
startingBlock.setIsFloor(true);
/* make the path */
SubPath subPath = SubPath(
(rand() % 5) + 2,
MapDirection::Up,
(rand() % 3) + 1);
/* Entrance landmark */
landmarks.emplace_back(getEntranceLandmark(Point(pathX, pathY)));
vector<Point> floorPositions;
/* while loop makes the path */
while (pathY > 0) {
/* choose the next block to floorize */
switch (subPath.direction) {
case MapDirection::Up:
if (pathY > 0) { /* We ARE allowed to hit the ceiling (FOR NOW this ends the pathmaking) */
--pathY;
}
else {
++pathY;
subPath.seed = 0;
}
break;
case MapDirection::Down:
if (pathY < rows.size() - 2) { /* We are NOT allowed to hit the bottom again. */
++pathY;
}
else {
--pathY;
subPath.seed = 0;
}
break;
case MapDirection::Left:
if (pathX > 3) { /* We are NOT allowed to hit the left wall. */
--pathX;
}
else {
++pathX;
subPath.seed = 0;
}
break;
case MapDirection::Right:
if (pathX < rows[pathY].size() - 2) { /* We are NOT allowed to hit the right wall. */
++pathX;
}
else {
--pathX;
subPath.seed = 0;
}
break;
}
floorize(pathX, pathY, subPath.radius);
floorPositions.push_back(Point(pathX, pathY));
--subPath.seed;
if (subPath.seed < 1) {
/* refresh seed */
subPath.direction = static_cast<MapDirection>(rand() % MapDirection::Total);
subPath.seed = (rand() % 12) + 1;
subPath.radius = rand() % 4;
}
}
/* Create Exit landmark. */
landmarks.emplace_back(getExitLandmark(Point(pathX, pathY)));
/* Set wall and floor texture indexes. */
for (int i = 0; i < rows.size(); ++i) {
vector<Block>& blocks = rows[i];
for (int k = 0; k < blocks.size(); ++k) {
Block& thisBlock = blocks[k];
thisBlock.setFloorTextureIndex(rand() % mapForm.floorTextures.size());
/* set texture values for Wall blocks (defaults if they're not wall blocks). */
if (thisBlock.getIsFloor()) {
thisBlock.setWallTextureIndex(0);
thisBlock.setWallIsFlipped(false);
}
else {
thisBlock.setWallTextureIndex(rand() % mapForm.wallTextures.size());
thisBlock.setWallIsFlipped(rand() % 2 == 0);
}
}
}
/* create Player Character */
/* get character texture */
SDL_Surface* characterSurface = IMG_Load("assets/player_character.png");
SDL_Texture* characterTexture = SDL_CreateTextureFromSurface(ui.getMainRenderer(), characterSurface);
SDL_FreeSurface(characterSurface);
playerCharacter = MapCharacter(CharacterType::Player, playerX, playerY);
playerCharacter.setTexture(characterTexture);
return floorPositions;
}
void Map::randomizePathOptions(Block& block) {
/* Set up PATH BLOCK info. The path can be flipped vertical, horizontal, or not at all. */
block.setPathTextureIndex(rand() % mapForm.pathTextures.size());
block.setPathFlipOption(rand() % 3);
/* The path can also be rotated 90 degrees, 270 degrees, or not at all. */
int pathRotateOption = rand() % 3;
block.setPathRotateAngle(pathRotateOption == 2 ? 270 : pathRotateOption == 1 ? 90 : 0);
}
/*
* When we create a path we want to clear a radius around each block of the central path.
* There's the opportunity here to draw an actual "path" block (different than a floor block... maybe non-diggable?).
* But only certain paths are *actual* paths... many are just normal floor blocks.
*/
void Map::floorize(int x, int y, int radius) {
/* Incoming coordinates are always a path */
Block& thisBlock = rows[y][x];
if (thisBlock.getIsPath()) { return; }
randomizePathOptions(thisBlock);
thisBlock.setIsPath(true);
/* If the block was already a floor, don't bother clearing the surrounding blocks. */
if (thisBlock.getIsFloor()) { return; }
thisBlock.setIsFloor(true);
if (y < (radius + 2)) { return; } /* don't clear top blocks (except exit block, which is already cleared) */
/* increment counters (to help reach radius) */
int upInc = 0;
int leftInc = 0;
int downInc = 0;
int rightInc = 0;
/* clear ABOVE */
while (y - upInc > 0 && upInc < radius) {
/* directly above */
rows[y - upInc][x].setIsFloor(true);
/* up and to the left */
while (x - leftInc > 0 && leftInc < radius) {
rows[y - upInc][x - leftInc].setIsFloor(true);
++leftInc;
}
leftInc = 0;
/* up and to the right */
while (x + rightInc < rows[y - upInc].size() - 2 && rightInc < radius) {
rows[y - upInc][x + rightInc].setIsFloor(true);
++rightInc;
}
rightInc = 0;
++upInc;
}
/* reset increment counters */
upInc = 0;
leftInc = 0;
downInc = 0;
rightInc = 0;
/* Clear BELOW */
while (y + downInc < rows.size() - 2 && downInc < radius) {
/* directly below */
rows[y + downInc][x].setIsFloor(true);
/* down and to the left */
while (x - leftInc > 0 && leftInc < radius) {
rows[y + downInc][x - leftInc].setIsFloor(true);
++leftInc;
}
leftInc = 0;
/* up and to the right */
while (x + rightInc < rows[y - upInc].size() - 2 && rightInc < radius) {
rows[y + downInc][x + rightInc].setIsFloor(true);
++rightInc;
}
rightInc = 0;
++downInc;
}
/* reset increment counters */
upInc = 0;
leftInc = 0;
/* Clear LEFT */
while (x - leftInc > 0 && leftInc < radius) {
rows[y][x - leftInc].setIsFloor(true);
++leftInc;
}
/* Clear RIGHT */
while (x + rightInc < rows[y - upInc].size() - 2 && rightInc < radius) {
rows[y][x + rightInc].setIsFloor(true);
++rightInc;
}
}