From ec4e06259947921b6958e3cdf27786904a79af2f Mon Sep 17 00:00:00 2001 From: Renaud G Date: Wed, 29 Jan 2020 01:40:46 +0100 Subject: Output tags for dice list. --- include/diceparser.h | 6 ++---- include/highlightdice.h | 6 ++++++ include/parsingtoolbox.h | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/diceparser.h b/include/diceparser.h index 1926e5f..31f9760 100644 --- a/include/diceparser.h +++ b/include/diceparser.h @@ -26,13 +26,10 @@ #include #include -#include "highlightdice.h" #include "diceparserhelper.h" +#include "highlightdice.h" //#include "node/executionnode.h" -typedef QList ListDiceResult; -typedef QMap ExportedDiceResult; - class ExplodeDiceNode; class ParsingToolBox; class DiceRollerNode; @@ -232,6 +229,7 @@ public: bool readValuesList(QString& str, ExecutionNode*& node); void cleanAll(); + private: /** * @brief readIfInstruction reads the current command to build if node with proper parameters. diff --git a/include/highlightdice.h b/include/highlightdice.h index 2e8f08a..c70a371 100644 --- a/include/highlightdice.h +++ b/include/highlightdice.h @@ -21,6 +21,7 @@ #define HighLightDice_H #include +#include #include class HighLightDice @@ -44,6 +45,8 @@ public: quint64 getFaces() const; void setFaces(const quint64& faces); + QString getResultString() const; + private: QList m_result; bool m_hasHighlight= true; @@ -52,4 +55,7 @@ private: quint64 m_faces; }; +typedef QList ListDiceResult; +typedef QMap ExportedDiceResult; + #endif // HighLightDice_H diff --git a/include/parsingtoolbox.h b/include/parsingtoolbox.h index 8d5f62b..038427f 100644 --- a/include/parsingtoolbox.h +++ b/include/parsingtoolbox.h @@ -26,6 +26,7 @@ #include "booleancondition.h" #include "compositevalidator.h" +#include "highlightdice.h" #include "node/dicerollernode.h" #include "node/executionnode.h" #include "node/ifnode.h" @@ -111,7 +112,7 @@ public: * @param str * @return */ - Validator* readValidator(QString& str, bool hasSquare=false); + Validator* readValidator(QString& str, bool hasSquare= false); /** * @brief readCompositeValidator * @param str @@ -227,8 +228,10 @@ public: static int findClosingCharacterIndexOf(QChar open, QChar closing, const QString& str, int offset); static QString replaceVariableToValue(const QString& source, QStringList values); + static QString replacePlaceHolderToValue(const QString& source, const QList& list); static SubtituteInfo readVariableFromString(const QString& source, int& start); + static SubtituteInfo readPlaceHolderFromString(const QString& source, int& start); static void readSubtitutionParameters(SubtituteInfo& info, QString& rest); -- cgit v1.2.3-70-g09d2