SHARE
TWEET

Untitled

a guest Aug 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. template <class T>
  2. class VoidActionNode : public BTNode
  3. {
  4. public:
  5.     VoidActionNode(T *givenMember, NODE_RETURN(*func)(T*)){ member = givenMember; function = func; }
  6.     ~VoidActionNode(){ function = nullptr; member = nullptr; }
  7.  
  8.     NODE_RETURN execute() override
  9.     {
  10.         if (function != nullptr && member != nullptr)
  11.         {
  12.             return function(member);
  13.         }
  14.  
  15.         return NODE_RETURN::ERROR;
  16.     }
  17.  
  18. private:
  19.     NODE_RETURN (*function)(T*) = nullptr;
  20.     T *member;
  21. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top