roulette-payout/PlayerAreaModel.h

69 lines
1.2 KiB
C
Raw Normal View History

#pragma once
#include <QQuickView>
#include <QtGui/qwindow.h>
#include <qobject.h>
#include <qqmlintegration.h>
#include <qtmetamacros.h>
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);
2024-06-01 13:19:32 +01:00
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);
2024-05-31 12:34:47 +01:00
public slots:
void setPlayerName(QString s, int n);
void bet(BetType b, int n, int bet);
void removeBet(BetType b, int n);
2024-06-01 13:19:32 +01:00
QString getPlayerName(int n);
void cancelBet(int n);
2024-06-01 13:19:32 +01:00
2024-05-31 12:34:47 +01:00
private:
2024-06-01 13:19:32 +01:00
struct Bet {
uint betValue = 0;
BetType betType = NONE;
uint betSpot = 0;
};
struct Player {
QString playerName = "";
Bet bet1;
Bet bet2;
};
QList<Player> players;
int focusedPlayer_;
};