|
|
|
@ -5,34 +5,33 @@ Level::Level()
|
|
|
|
|
// Fill the level with water
|
|
|
|
|
for (Row &row : map)
|
|
|
|
|
{
|
|
|
|
|
for (char &cell : row)
|
|
|
|
|
cell = '.';
|
|
|
|
|
for (CellType &cell : row)
|
|
|
|
|
cell = CellType::Water;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Temporary mock
|
|
|
|
|
|
|
|
|
|
// Ground
|
|
|
|
|
map[1][2] = '-';
|
|
|
|
|
map[1][3] = '-';
|
|
|
|
|
map[1][4] = '-';
|
|
|
|
|
map[2][2] = '-';
|
|
|
|
|
map[3][2] = '-';
|
|
|
|
|
map[3][3] = '-';
|
|
|
|
|
// Charge
|
|
|
|
|
map[2][3] = '$';
|
|
|
|
|
map[1][2] = CellType::Ground;
|
|
|
|
|
map[1][3] = CellType::Ground;
|
|
|
|
|
map[1][4] = CellType::Ground;
|
|
|
|
|
map[2][2] = CellType::Ground;
|
|
|
|
|
map[3][2] = CellType::Ground;
|
|
|
|
|
map[3][3] = CellType::Ground;
|
|
|
|
|
|
|
|
|
|
map[2][3] = CellType::Charge;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Level::placeBridge(coordinate x, coordinate y)
|
|
|
|
|
{
|
|
|
|
|
map[x][y] = static_cast<char>(177);
|
|
|
|
|
map[x][y] = CellType::Bridge;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Level::isCellOfType(coordinate x, coordinate y, char type) const
|
|
|
|
|
bool Level::isCellOfType(coordinate x, coordinate y, CellType type) const
|
|
|
|
|
{
|
|
|
|
|
return (map[x][y] == type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Level::removeCharge(coordinate x, coordinate y)
|
|
|
|
|
{
|
|
|
|
|
map[x][y] = '-';
|
|
|
|
|
map[x][y] = CellType::Ground;
|
|
|
|
|
}
|
|
|
|
|