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.py 965 B

123456789101112131415161718192021222324252627
  1. from abc import abstractmethod
  2. from typing import Union
  3. from Interface import IHumanAPI, IButcherAPI, IAI
  4. import structures as THUAI6
  5. class Setting:
  6. # 为假则play()期间确保游戏状态不更新,为真则只保证游戏状态在调用相关方法时不更新
  7. def asynchronous() -> bool:
  8. return False
  9. # 选手必须修改该函数的返回值来选择自己的阵营
  10. def playerType() -> THUAI6.PlayerType:
  11. return THUAI6.PlayerType.HumanPlayer
  12. # 选手需要将两个都定义,本份代码中不选择的阵营任意定义即可
  13. def humanType() -> THUAI6.HumanType:
  14. return THUAI6.HumanType.HumanType1
  15. def butcherType() -> THUAI6.ButcherType:
  16. return THUAI6.ButcherType.ButcherType1
  17. class AI(IAI):
  18. def play(self, api: Union[IHumanAPI, IButcherAPI]) -> None:
  19. # 选手在这里实现自己的逻辑,要求和上面选择的阵营保持一致,否则会发生错误
  20. return