for algorithm
| 185 | |
| 186 | // for algorithm |
| 187 | int State::countActionPriority(const ActionFilterPtr &filter, bool includeBack) const { |
| 188 | int totalP = 0; |
| 189 | for (const auto &action: this->_actions) { |
| 190 | if (!includeBack && action->isBack()) { |
| 191 | continue; |
| 192 | } |
| 193 | if (filter->include(action)) { |
| 194 | int fp = filter->getPriority(action); |
| 195 | if (fp <= 0) { |
| 196 | BDLOG("Error: Action should has a positive priority, but we get %d", fp); |
| 197 | return -1; |
| 198 | } |
| 199 | totalP += fp; |
| 200 | } |
| 201 | } |
| 202 | return totalP; |
| 203 | } |
| 204 | |
| 205 | ActivityStateActionPtrVec State::targetActions() const { |
| 206 | ActivityStateActionPtrVec retV; |
no test coverage detected