MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / tick

Method tick

tests/gtest_blackboard.cpp:360–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358 }
359
360 BT::NodeStatus tick() override
361 {
362 int32_t firstValue = 0;
363 int32_t secondValue = 0;
364 std::string inputOperator;
365 if(!getInput("first", firstValue) || !getInput("second", secondValue) ||
366 !getInput("operator", inputOperator))
367 {
368 throw RuntimeError("can't access input");
369 }
370 if((inputOperator == "==" && firstValue == secondValue) ||
371 (inputOperator == "!=" && firstValue != secondValue) ||
372 (inputOperator == "<=" && firstValue <= secondValue) ||
373 (inputOperator == ">=" && firstValue >= secondValue) ||
374 (inputOperator == "<" && firstValue < secondValue) ||
375 (inputOperator == ">" && firstValue > secondValue))
376 {
377 return BT::NodeStatus::SUCCESS;
378 }
379 // skipping the rest of the implementation
380 return BT::NodeStatus::FAILURE;
381 }
382};
383
384TEST(BlackboardTest, IssueSetBlackboard)

Callers

nothing calls this directly

Calls 1

RuntimeErrorClass · 0.85

Tested by

no test coverage detected