AndNode.cc 418 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "Event/AndNode.h"
  2. namespace Egametang {
  3. AndNode::~AndNode()
  4. {
  5. delete left;
  6. delete right;
  7. }
  8. bool AndNode::Check(ContexIf* contex)
  9. {
  10. if (!left->Check(contex))
  11. {
  12. return false;
  13. }
  14. if (!right->Check(contex))
  15. {
  16. return false;
  17. }
  18. return true;
  19. }
  20. void AndNode::AddChildNode(NodeIf *node, int type)
  21. {
  22. if (type == 0)
  23. {
  24. left = node;
  25. }
  26. else
  27. {
  28. right = node;
  29. }
  30. }
  31. } // namespace Egametang