C++/BehaviorTreesLib/Timer.cpp
EStatus Timer::tickNode()
	{
		if (timerSet)
		{
			this->setResult(EStatus::RUNNING);
		}
		else if (mInnerResult != EStatus::RUNNING)
		{
			this->setResult(mInnerResult);
		}
		else
		{
			if (!timerSet)
			{
				std::thread timer(&Timer::setTimer, this);
				timerSet = true;
				timer.detach();
			}

			this->setResult(EStatus::RUNNING);
		}
		return this->getResult();
	}
// Wait until ms is reached and run child. Return running during that time
Wait until ms is reached and run child. Return running during that time
Wait until ms is reached and run child . Return running during that time
EStatus Timer::tickNode()
	{
		if (timerSet)
		{
			this->setResult(EStatus::RUNNING);
		}
		else if (mInnerResult != EStatus::RUNNING)
		{
			this->setResult(mInnerResult);
		}
		else
		{
			if (!timerSet)
			{
				std::thread timer(&Timer::setTimer, this);
				timerSet = true;
				timer.detach();
			}
			this->setResult(EStatus::RUNNING);
		}
		return this->getResult();
	}
EStatus Timer :: tickNode ( ) { if ( timerSet ) { this -> setResult ( EStatus :: RUNNING ) ; } else if ( mInnerResult != EStatus :: RUNNING ) { this -> setResult ( mInnerResult ) ; } else { if ( ! timerSet ) { std :: thread timer ( & Timer :: setTimer , this ) ; timerSet = true ; timer . detach ( ) ; } this -> setResult ( EStatus :: RUNNING ) ; } return this -> getResult ( ) ; }
Wait until ms is reached and run child.
Wait until ms is reached and run child .