aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/die.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2019-09-05 00:40:40 +0200
committerRenaud G <renaud@rolisteam.org>2019-09-05 00:40:40 +0200
commit1c875b651df3afafe1df6b8ae412124d67e526a6 (patch)
treee79f03a998c10f9d546b4ece060af68956bacca4 /die.cpp
parentb0ec3dfffda7991eee5775dcebb04731ba6a8389 (diff)
downloadOneRoll-1c875b651df3afafe1df6b8ae412124d67e526a6.tar.gz
OneRoll-1c875b651df3afafe1df6b8ae412124d67e526a6.zip
Copy die but prevent them to be displayed twice.
Diffstat (limited to 'die.cpp')
-rw-r--r--die.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/die.cpp b/die.cpp
index 531853c..884472d 100644
--- a/die.cpp
+++ b/die.cpp
@@ -24,10 +24,12 @@
#include <QDateTime>
#include <QDebug>
+#include <QUuid>
#include <chrono>
Die::Die()
- : m_hasValue(false)
+ : m_uuid(QUuid::createUuid().toString(QUuid::WithoutBraces))
+ , m_hasValue(false)
, m_displayStatus(false)
, m_highlighted(true)
, m_base(1)
@@ -43,6 +45,7 @@ Die::Die(const Die& die)
m_rollResult= die.m_rollResult;
m_selected= die.m_selected;
m_hasValue= die.m_hasValue;
+ m_uuid= die.m_uuid;
m_displayStatus= die.m_displayStatus;
m_maxValue= die.m_maxValue;
m_highlighted= die.m_highlighted;
@@ -226,3 +229,12 @@ void Die::setOp(const Die::ArithmeticOperator& op)
{
m_op= op;
}
+QString Die::getUuid() const
+{
+ return m_uuid;
+}
+
+void Die::setUuid(const QString& uuid)
+{
+ m_uuid= uuid;
+}