diff options
| author | 2014-12-09 20:39:15 +0100 | |
|---|---|---|
| committer | 2014-12-09 20:39:15 +0100 | |
| commit | 23ea53c2aa66a9591c96108f5d9584f8123eb09a (patch) | |
| tree | 331903f20d34e0dfa36d9b8dc3cc1a507da65ab9 /diceparser.cpp | |
| parent | d044490547eb9c5b14bc937ee7cce448ea29d562 (diff) | |
| download | OneRoll-23ea53c2aa66a9591c96108f5d9584f8123eb09a.tar.gz OneRoll-23ea53c2aa66a9591c96108f5d9584f8123eb09a.zip | |
-add command management
Diffstat (limited to 'diceparser.cpp')
| -rw-r--r-- | diceparser.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index c94c2b5..5d4a610 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -60,6 +60,10 @@ DiceParser::DiceParser() m_aliasMap->insert("l5R","D10e10k"); m_aliasMap->insert("nwod","D10e10c[>7]"); m_aliasMap->insert("nwod","D10e10c[>7]"); + + + m_commandList = new QList<QString>(); + m_commandList->append("help"); } ExecutionNode* DiceParser::getLatestNode(ExecutionNode* node) @@ -142,6 +146,10 @@ bool DiceParser::readExpression(QString& str,ExecutionNode* & node) } + else if(readCommand(str,operandNode)) + { + return true; + } else { ExecutionNode* diceNode=NULL; @@ -294,6 +302,14 @@ bool DiceParser::readDiceOperator(QString& str,DiceOperator& op) } return false; } +bool DiceParser::readCommand(QString& str,ExecutionNode* & node) +{ + if(m_commandList->contains(str)) + { + // node = new HelpNode(); + } +} + bool DiceParser::readDiceExpression(QString& str,ExecutionNode* & node) { int number=1; |