| 13 | |
| 14 | template <size_t N> |
| 15 | inline void RegisterTestTick(BT::BehaviorTreeFactory& factory, |
| 16 | const std::string& name_prefix, |
| 17 | std::array<int, N>& tick_counters) |
| 18 | { |
| 19 | for(size_t i = 0; i < tick_counters.size(); i++) |
| 20 | { |
| 21 | tick_counters[i] = false; |
| 22 | char str[100]; |
| 23 | (void)snprintf(str, sizeof str, "%s%c", name_prefix.c_str(), char('A' + i)); |
| 24 | int* counter_ptr = &(tick_counters[i]); |
| 25 | factory.registerSimpleAction(str, std::bind(&TestTick, counter_ptr)); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | #endif // TEST_HELPER_HPP |