37 lines
774 B
C++
37 lines
774 B
C++
#pragma once
|
|
#include <SFML/Window.hpp>
|
|
#include <SFML/Graphics.hpp>
|
|
#include "brick.hpp"
|
|
|
|
class BrickGrid
|
|
{
|
|
private:
|
|
inline static const sf::Color color {100, 200, 250};
|
|
|
|
sf::FloatRect m_border;
|
|
int m_numBrickColumns;
|
|
int m_numBrickRows;
|
|
|
|
std::vector<Brick> m_bricks;
|
|
sf::RectangleShape m_brickShape;
|
|
|
|
int m_numActiveBricks;
|
|
|
|
public:
|
|
BrickGrid();
|
|
BrickGrid(sf::FloatRect borders, int numBrickColumns, int numBrickRows);
|
|
|
|
sf::FloatRect getBorder() const;
|
|
|
|
sf::Vector2i getGridSizes() const;
|
|
|
|
sf::Vector2f getBrickSizes() const;
|
|
|
|
bool isBrickActive(std::pair<int, int> indexes) const;
|
|
|
|
void deactivateBrick(std::pair<int, int> indexes);
|
|
|
|
int getNumActiveBricks() const;
|
|
|
|
void draw(sf::RenderWindow& window);
|
|
};
|