#include "sortresult.h" #include SortResultNode::SortResultNode() { m_ascending = true; } void SortResultNode::run(ExecutionNode* node) { if(NULL==node) { return; } QList diceList=node->getResult()->getResultList(); QList diceList2=m_result.getResultList(); diceList2 = diceList; if(!m_ascending) { qSort(diceList2.begin(), diceList2.end(), qGreater()); } else { qSort(diceList2.begin(), diceList2.end(), qLess()); } m_result.setResultList(diceList2); if(NULL!=m_nextNode) { m_nextNode->run(this); } } void SortResultNode::setSortAscending(bool asc) { m_ascending = asc; }