You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

AI.h 576 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #ifndef AI_H
  3. #define AI_H
  4. #include "API.h"
  5. #undef GetMessage
  6. #undef SendMessage
  7. #undef PeekMessage
  8. class IAI
  9. {
  10. public:
  11. virtual ~IAI() = default;
  12. IAI() = default;
  13. virtual void play(IStudentAPI& api) = 0;
  14. virtual void play(ITrickerAPI& api) = 0;
  15. };
  16. using CreateAIFunc = std::unique_ptr<IAI> (*)(int64_t playerID);
  17. class AI : public IAI
  18. {
  19. public:
  20. AI(int64_t pID) :
  21. IAI(),
  22. playerID(pID)
  23. {
  24. }
  25. void play(IStudentAPI& api) override;
  26. void play(ITrickerAPI& api) override;
  27. private:
  28. int64_t playerID;
  29. };
  30. #endif