38 lines
762 B
C++
38 lines
762 B
C++
|
#include "grid_debug_layer.h"
|
||
|
#include "../primitives/circle_object.h"
|
||
|
|
||
|
GridDebugLayer::GridDebugLayer(int minX, int maxX, int minY, int maxY)
|
||
|
{
|
||
|
// Generate markers
|
||
|
for (int x = minX; x <= maxX; x++)
|
||
|
{
|
||
|
for (int y = minY; y <= maxY; y++)
|
||
|
{
|
||
|
auto *gameObject = new CircleObject(5, sf::Color::Red);
|
||
|
gameObject->coordinates.set(WorldCoordinates(x, y, 0));
|
||
|
marker.push_back(gameObject);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
GridDebugLayer::~GridDebugLayer()
|
||
|
{
|
||
|
for (auto &gameObject: marker)
|
||
|
{
|
||
|
delete gameObject;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void GridDebugLayer::draw(sf::RenderWindow *window) const
|
||
|
{
|
||
|
for (auto &gameObject: marker)
|
||
|
{
|
||
|
gameObject->draw(window);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void GridDebugLayer::update() const
|
||
|
{
|
||
|
|
||
|
}
|