#include <iostream>
#include "SFML/Graphics.hpp"

#include "headers/Plansza.h"

int main()
{
    std::clog << "Game started\n";
    sf::RenderWindow mainWindow(sf::VideoMode(600, 800), "LotoStatek");
    mainWindow.setVerticalSyncEnabled(true);
    mainWindow.setFramerateLimit(60);

    sf::Image icon;
    icon.loadFromFile("../assets/img/icon/ikonka.png");
    mainWindow.setIcon(128, 128, icon.getPixelsPtr());

    Plansza plansza(mainWindow.getSize().y, mainWindow.getSize().x, &mainWindow);

    while (mainWindow.isOpen()) {
        mainWindow.clear();

        // Tu są handlowane eventy
        sf::Event event{};
        while (mainWindow.pollEvent(event)) {
            if(event.type == sf::Event::Closed || sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                mainWindow.close();
        }

        plansza.update();

        mainWindow.display();
    }

    return 0;
}