From 1c875b651df3afafe1df6b8ae412124d67e526a6 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Thu, 5 Sep 2019 00:40:40 +0200 Subject: Copy die but prevent them to be displayed twice. --- die.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'die.cpp') diff --git a/die.cpp b/die.cpp index 531853c..884472d 100644 --- a/die.cpp +++ b/die.cpp @@ -24,10 +24,12 @@ #include #include +#include #include 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; +} -- cgit v1.2.3-70-g09d2