BehaviorNode.h 666 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef BEHAVIORTREE_BEHAVIORNODE_H
  2. #define BEHAVIORTREE_BEHAVIORNODE_H
  3. #include <string>
  4. #include "Base/Typedef.h"
  5. namespace Egametang {
  6. class ContexIf;
  7. class BehaviorNodeConf;
  8. class BehaviorNode
  9. {
  10. private:
  11. int32 type;
  12. public:
  13. BehaviorNode(int32 type): type(type)
  14. {
  15. }
  16. virtual ~BehaviorNode()
  17. {
  18. }
  19. int32 Type() const
  20. {
  21. return type;
  22. }
  23. virtual void AddChildNode(BehaviorNode *node)
  24. {
  25. }
  26. virtual bool Run(ContexIf* contex) = 0;
  27. virtual std::string ToString() = 0;
  28. };
  29. class BehaviorNodeFactoryIf
  30. {
  31. public:
  32. virtual BehaviorNode* GetInstance(const BehaviorNodeConf& conf) = 0;
  33. };
  34. } // namespace Egametang
  35. #endif // BEHAVIORTREE_BEHAVIORNODE_H