#pragma once #include #include #include #include #include class PlayerAreaModel : public QObject { Q_OBJECT QML_NAMED_ELEMENT(PlayerAreaModel) QML_SINGLETON Q_PROPERTY(uint focusedPlayer READ focusedPlayer WRITE setFocusedPlayer NOTIFY focusedPlayerChanged) public: explicit PlayerAreaModel(QObject *parent = nullptr); uint focusedPlayer(); void setFocusedPlayer(int n); enum BetType { NONE, RED, BLACK, ODD, EVEN, LOW, HIGH, DOZEN, STREET, SINGLE, SPLIT }; Q_ENUM(BetType) signals: void focusedPlayerChanged(BetType b1, uint n1, BetType b2, uint n2); void betCanceled(uint n); public slots: void setPlayerName(QString s, int n); void bet(BetType b, int n, int bet); void removeBet(BetType b, int n); QString getPlayerName(int n); void cancelBet(int n); private: struct Bet { uint betValue = 0; BetType betType = NONE; uint betSpot = 0; }; struct Player { QString playerName = ""; Bet bet1; Bet bet2; }; QList players; int focusedPlayer_; };