From e0be899041064c0ffce1e32bc789bd12502a73fc Mon Sep 17 00:00:00 2001 From: obiwankennedy Date: Tue, 14 Jan 2014 18:44:17 +0100 Subject: Update die.cpp adding getFaces and getLastRolledValue API --- die.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/die.cpp b/die.cpp index 7ab78e9..0ce09a6 100644 --- a/die.cpp +++ b/die.cpp @@ -75,8 +75,21 @@ void Die::roll(bool adding) } } +quint64 Die::getFaces() +{ + return m_faces; +} void Die::setFaces(quint64 face) { m_faces=face; } +qint64 Die::getLastRolledValue() +{ + if(!m_rollResult.isEmpty()) + { + return m_rollResult.last(); + } + else + return 0; +} -- cgit v1.2.3-70-g09d2