2023-06-13 22:40:55 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
class RuneAspektButton;
|
|
|
|
class RuneAspektButtonGroup : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
RuneAspektButtonGroup(QObject* parent, uint32_t size);
|
|
|
|
virtual ~RuneAspektButtonGroup();
|
|
|
|
|
|
|
|
void addButton(RuneAspektButton* button);
|
|
|
|
void setSelectedRunes(const QVector<int>& newRunes);
|
|
|
|
|
|
|
|
constexpr const QVector<int>& getSelectedRunes() const { return selectedRune; }
|
|
|
|
constexpr uint32_t getSize() const { return size; }
|
|
|
|
|
2023-06-19 20:58:55 +02:00
|
|
|
void setSubgroups(const QVector<QVector<int>>& newSubgroups);
|
|
|
|
|
|
|
|
static const int INVALID_ASPEKT_ID;
|
2023-06-13 22:40:55 +02:00
|
|
|
signals:
|
|
|
|
void changed(); // signal that the group was changed -> all buttons should refresh
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void buttonPressed(int aspektId);
|
|
|
|
|
|
|
|
private:
|
2023-06-19 20:58:55 +02:00
|
|
|
// try to fetch a aspektId, that is in selectedRune and in the same subgroup as aspektId
|
|
|
|
// return 0 when no suitable candidate is found
|
|
|
|
int getOtherSubgroupMemeber(int aspketId);
|
|
|
|
|
2023-06-13 22:40:55 +02:00
|
|
|
QVector<int> selectedRune;
|
2023-06-19 20:58:55 +02:00
|
|
|
QVector<QVector<int>> subgroups; // might be empty
|
2023-06-13 22:40:55 +02:00
|
|
|
uint32_t size = 0;
|
|
|
|
};
|