#pragma once

#include <string>
#include <vector>

#include <QFrame>
#include <QLabel>
#include <QPushButton>

#include "ArenaSimulation.h"

class ArenaWidget : public QFrame
{
    Q_OBJECT

public:
    enum class State
    {
        NotStarted,
        Running,
        Ended
    };

    ArenaWidget(int arenaIndex, const std::string& arenaName, QWidget* parent = nullptr);

    void updateStatus(const ArenaStatus& status);
    void startSimulation();
    void resetToGrey();

    const ArenaStatus& getLastStatus() const { return m_lastStatus; }
    State getState() const;

private:
    void buildLayout(const std::string& arenaName);

    int m_arenaIndex;
    ArenaStatus m_lastStatus;
    QLabel* m_titleLabel;
    QLabel* m_durationLabel;
    QLabel* m_team1Header;
    QLabel* m_team2Header;
    QLabel* m_team1Threat;
    QLabel* m_team2Threat;
    QLabel* m_team1Ehp;
    QLabel* m_team2Ehp;
    QLabel* m_team1Content;
    QLabel* m_team2Content;
    QPushButton* m_inspectButton;
    QPushButton* m_startButton;
    bool m_running;
    bool m_wasFinished;
};
