You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
646 B
C++

#include "level.h"
Level::Level()
{
// Fill the level with water
for (Row &row : map)
{
for (char &cell : row)
cell = '.';
}
// 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] = '$';
}
void Level::placeBridge(coordinate x, coordinate y)
{
map[x][y] = static_cast<char>(177);
}
bool Level::isCellOfType(coordinate x, coordinate y, char type) const
{
return (map[x][y] == type);
}
void Level::removeCharge(coordinate x, coordinate y)
{
map[x][y] = '-';
}