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.cpp 824 B

123456789101112131415161718192021222324252627
  1. #include <vector>
  2. #include <thread>
  3. #include "AI.h"
  4. // 为假则play()期间确保游戏状态不更新,为真则只保证游戏状态在调用相关方法时不更新
  5. extern const bool asynchronous = false;
  6. // 选手必须定义该变量来选择自己的阵营
  7. extern const THUAI6::PlayerType playerType = THUAI6::PlayerType::StudentPlayer;
  8. // 选手需要将两个都定义,本份代码中不选择的阵营任意定义即可
  9. extern const THUAI6::TrickerType trickerType = THUAI6::TrickerType::Assassin;
  10. extern const THUAI6::StudentType studentType = THUAI6::StudentType::Athlete;
  11. // 选手只需写一个即可,为了调试方便写了两个的话也不会有影响
  12. void AI::play(IStudentAPI& api)
  13. {
  14. api.Move(100, 1);
  15. api.PrintSelfInfo();
  16. }
  17. void AI::play(ITrickerAPI& api)
  18. {
  19. api.Move(100, 1);
  20. }