HOG2
Classes | Functions
MapGenerators.cpp File Reference
#include "MapGenerators.h"
#include <vector>
#include <algorithm>
#include <random>
Include dependency graph for MapGenerators.cpp:

Go to the source code of this file.

Classes

struct  loc
 

Functions

void MakePseudoMaze (Map *map, int pathSize)
 MakeMaze(map, pathsize) More...
 
void MakeMaze (Map *map, int corridorWidth, int startx, int starty)
 MakeMaze(map) More...
 
void BuildRandomRoomMap (Map *map, int roomSize, int openingProbability)
 
void MakeRandomMap (Map *map, int obstacles)
 
void StraightDir (Map *m, loc l, std::vector< loc > &dirs)
 
void PossibileDirs (Map *m, loc l, std::vector< loc > &dirs)
 
void Burrow (Map *m, loc l1, loc l2)
 
void MakeMaze (Map *m, float straightPercent, float branchPercent)
 
MapMakeWarehouseMap (int columns, int rows, int corridor, int shelfWidth, int shelfHeight, int leftMargin, int rightMargin)
 

Function Documentation

◆ BuildRandomRoomMap()

void BuildRandomRoomMap ( Map map,
int  roomSize,
int  openingProbability 
)

◆ Burrow()

void Burrow ( Map m,
loc  l1,
loc  l2 
)

Definition at line 327 of file MapGenerators.cpp.

References kGround, Map::SetTerrainType(), loc::x, and loc::y.

Referenced by MakeMaze().

◆ MakeMaze() [1/2]

void MakeMaze ( Map m,
float  straightPercent,
float  branchPercent 
)

◆ MakeMaze() [2/2]

void MakeMaze ( Map map,
int  corridorWidth,
int  startx,
int  starty 
)

◆ MakePseudoMaze()

void MakePseudoMaze ( Map map,
int  pathSize 
)

MakeMaze(map, pathsize)

A cheap function I hacked together to make psuedo mazes. The only good values for pathSize are 1 and 3.

Definition at line 20 of file MapGenerators.cpp.

References Map::GetHeight(), Map::GetMapHeight(), Map::GetMapWidth(), height, kGround, kOutOfBounds, Map::SetHeight(), Map::SetRectHeight(), Map::SetTerrainType(), and width.

◆ MakeRandomMap()

void MakeRandomMap ( Map map,
int  obstacles 
)

◆ MakeWarehouseMap()

Map* MakeWarehouseMap ( int  columns,
int  rows,
int  corridor,
int  shelfWidth,
int  shelfHeight,
int  leftMargin,
int  rightMargin 
)

Definition at line 388 of file MapGenerators.cpp.

References kTrees.

◆ PossibileDirs()

void PossibileDirs ( Map m,
loc  l,
std::vector< loc > &  dirs 
)

Definition at line 314 of file MapGenerators.cpp.

References Map::GetTerrainType(), kTrees, loc::x, and loc::y.

Referenced by MakeMaze().

◆ StraightDir()

void StraightDir ( Map m,
loc  l,
std::vector< loc > &  dirs 
)

Definition at line 298 of file MapGenerators.cpp.

References Map::GetTerrainType(), kGround, kTrees, loc::x, and loc::y.

Referenced by MakeMaze().