This commit is contained in:
bart
2026-11-08 15:42:54 +01:00
parent dfd497d728
commit 5af4581182
80 changed files with 4494 additions and 437 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef PLAYER_H
#define PLAYER_H
#include <QString>
#include <QColor>
#include <vector>
struct Player {
int id;
QString name;
QColor primaryColor;
QColor secondaryColor;
Player() : id(0), name("Unknown"), primaryColor(Qt::blue), secondaryColor(Qt::white) {}
Player(int pId, const QString &pName, const QColor &primary, const QColor &secondary)
: id(pId), name(pName), primaryColor(primary), secondaryColor(secondary) {}
};
class PlayerManager {
public:
PlayerManager();
bool addPlayer(int id, const QString &name, const QColor &primary, const QColor &secondary);
const Player* getPlayer(int id) const;
Player* getPlayer(int id);
const std::vector<Player>& getPlayers() const { return m_players; }
bool isCombinationUnique(const QColor &primary, const QColor &secondary, int excludeId = -1) const;
private:
std::vector<Player> m_players;
};
#endif // PLAYER_H