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.

34 lines
657 B
C++

#ifndef LEVEL_H
#define LEVEL_H
#include <array>
constexpr int side = 32;
using Row = std::array<char, side>;
using Map = std::array<Row, side>;
/// Abstraction over 2D array to quickly get access to unchangable level cells
class Level
{
private:
Map map;
public:
Level();
/// Place a bridge cell
void placeBridge(Row::size_type x, Row::size_type y);
/// Get the 2D array of level map
Map& mapArray() const;
/// Request cell type
bool isWater(Row::size_type x, Row::size_type y) const;
/// Replace a charge cell with a ground cell
void removeCharge(Row::size_type x, Row::size_type y);
};
#endif // LEVEL_H