diff options
| author | 2018-12-15 02:15:27 +0100 | |
|---|---|---|
| committer | 2018-12-15 02:18:16 +0100 | |
| commit | 2eaaedebc6750d5984190fd0f87caf771b248ae0 (patch) | |
| tree | 3a45b8bf7406cade153e088cd04a495a4c29e53f /node/sortresult.cpp | |
| parent | 6204fbaab592179f0556eb673c61fa3d3313d2a7 (diff) | |
| download | OneRoll-2eaaedebc6750d5984190fd0f87caf771b248ae0.tar.gz OneRoll-2eaaedebc6750d5984190fd0f87caf771b248ae0.zip | |
WIP
Diffstat (limited to 'node/sortresult.cpp')
| -rw-r--r-- | node/sortresult.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/node/sortresult.cpp b/node/sortresult.cpp index 5406eb6..76f517e 100644 --- a/node/sortresult.cpp +++ b/node/sortresult.cpp @@ -42,15 +42,32 @@ void SortResultNode::run(ExecutionNode* node) m_diceResult->setPrevious(previousDiceResult); if(nullptr!=previousDiceResult) { - QList<Die*> diceList=previousDiceResult->getResultList(); + auto const& diceList=previousDiceResult->getResultList(); QList<Die*> diceList2=m_diceResult->getResultList(); + /* const auto& asce = [](const Die* a,const Die* b){ + return a->getValue() < b->getValue(); + }; + const auto& desc = [](const Die* a,const Die* b){ + return a->getValue() > b->getValue(); + }; + + for(auto const dice : diceList) + { + Die* tmp1 = new Die(*dice); + diceList2.append(tmp1); + } + if(m_ascending) + std::sort(diceList2.begin(), diceList2.end(), asce); + else + std::sort(diceList2.begin(), diceList2.end(), desc);*/ + // half-interval search sorting for(int i = 0; i<diceList.size();++i) { - Die* tmp1 = new Die(); - *tmp1=*diceList[i]; + Die* tmp1 = new Die(*diceList[i]); + //*tmp1=*diceList[i]; diceList[i]->displayed(); int j =0; |