Advertisement
Guest User

Untitled

a guest
Oct 21st, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <functional>
  2.  
  3. //.h
  4.  
  5. struct FCharacterCombatState
  6. {
  7.     std::function<void(void)> OnBeginState;
  8.  
  9.     FCharacterCombatState()
  10.     {
  11.     }
  12. };
  13.  
  14. class MyClass
  15. {
  16.     MyClass();
  17.     FCharacterCombatState CombatState;
  18.  
  19.     void Foo();
  20. };
  21.  
  22.  
  23.  
  24. //.cpp
  25.  
  26. MyClass::MyClass()
  27. {
  28.     CombatState = FCharacterCombatState();
  29.     CombatState.OnBeginState = [this]() {
  30.         this->Foo();
  31.     };
  32. }
  33.  
  34. void MyClass::Foo()
  35. {
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement