Advertisement
HateDread

GOAP Action Base Class

May 20th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #pragma once
  2. #include <vector>
  3.  
  4. class Agent;
  5. class Property;
  6. class WorldState;
  7.  
  8. enum ConditionType
  9. {
  10.     eENEMY_DEAD,
  11.     eWEAPON_DRAWN,
  12.     eWEAPON_LOADED,
  13.     eHAS_TARGET
  14. };
  15.  
  16. struct WorldProperty
  17. {
  18.     union Value
  19.     {
  20.         bool    bValue;
  21.         float   fValue;
  22.         int nValue;
  23.     };
  24.  
  25.     unsigned int    subjectID;
  26.     ConditionType   type;
  27.     Value       value;
  28. };
  29.  
  30. class Action
  31. {
  32. public:
  33.     Action(void);
  34.     ~Action(void);
  35.    
  36.     virtual void Execute(Agent* a_agent, WorldState* a_currentState) = 0;
  37.  
  38. protected:
  39.     std::vector<WorldProperty*> m_preConditions;
  40.     // need effects here
  41. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement