2023-05-03 23:46:41 +02:00
|
|
|
#include "grid_debug_layer.h"
|
|
|
|
#include "../primitives/circle_object.h"
|
2023-05-07 12:27:11 +02:00
|
|
|
#include "../config.h"
|
2023-05-03 23:46:41 +02:00
|
|
|
|
|
|
|
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++)
|
|
|
|
{
|
2023-05-07 12:27:11 +02:00
|
|
|
auto *gameObject = new CircleObject(DB_ISOPLANE_CORNER_RADIUS, sf::Color::Red);
|
2023-05-03 23:46:41 +02:00
|
|
|
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
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|