#pragma once

#include <QObject>
#include <QQuickWindow>

class CycleCounter : public QObject {
    Q_OBJECT
    Q_PROPERTY(int countCycle READ countCycle WRITE setCountCycle NOTIFY countCycleChanged)
public:
    CycleCounter() { m_cycle = 0; }
    int countCycle() const { return m_cycle; }
    void setCountCycle(int newValue) { m_cycle = (newValue < 0) ? 0 : newValue > m_maxcycle ? 1 : newValue; emit countCycleChanged(); }

signals:
    void countCycleChanged();

private:
    const int m_maxcycle = 4;
    int m_cycle = 0;
};
