This repository has been archived on 2023-05-13. You can view files and clone it, but cannot push or open issues or pull requests.
mipt_cpp/term1/seminar13_polymorphism/arkanoid/brick_grid.hpp

38 lines
774 B
C++
Raw Normal View History

2023-02-25 19:34:24 +03:00
#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);
};