Clean up GameState constructor
This commit is contained in:
parent
fdc3405366
commit
3ab8cfb7dc
|
@ -1,19 +1,15 @@
|
||||||
#include "gamestate.h"
|
#include "gamestate.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
#include <qlist.h>
|
||||||
#include <qqmllist.h>
|
#include <qqmllist.h>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
GameState::GameState(QObject* parent, bool preDealCards) : QObject{parent} {
|
GameState::GameState(QObject* parent, bool preDealCards) : QObject{parent}, m_columns(7), m_foundation(4), m_gameWon(false) {
|
||||||
assert(connect(this, &GameState::foundationChanged, this, &GameState::onFoundationChanged));
|
assert(connect(this, &GameState::foundationChanged, this, &GameState::onFoundationChanged));
|
||||||
|
|
||||||
m_foundation.resize(4);
|
if (preDealCards)
|
||||||
m_columns.resize(7);
|
|
||||||
m_gameWon = false;
|
|
||||||
|
|
||||||
if (preDealCards) {
|
|
||||||
dealCards();
|
dealCards();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GameState::~GameState() {
|
GameState::~GameState() {
|
||||||
|
|
Loading…
Reference in a new issue