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.

API.py 5.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. from Interface import ILogic, IHumanAPI, IButcherAPI, IGameTimer, IAI
  2. from typing import List, Union
  3. import structures as THUAI6
  4. class HumanAPI(IHumanAPI, IGameTimer):
  5. # 指挥本角色进行移动,`timeInMilliseconds` 为移动时间,单位为毫秒;`angleInRadian` 表示移动的方向,单位是弧度,使用极坐标——竖直向下方向为 x 轴,水平向右方向为 y 轴
  6. def __init__(self, logic: ILogic):
  7. self.__logic = logic
  8. def Move(self, timeInMilliseconds: int, angle: float) -> bool:
  9. pass
  10. # 向特定方向移动
  11. def MoveRight(self, timeInMilliseconds: int) -> bool:
  12. pass
  13. def MoveLeft(self, timeInMilliseconds: int) -> bool:
  14. pass
  15. def MoveUp(self, timeInMilliseconds: int) -> bool:
  16. pass
  17. def MoveDown(self, timeInMilliseconds: int) -> bool:
  18. pass
  19. # 道具和技能相关
  20. def PickProp(self, propType: THUAI6.PropType) -> bool:
  21. pass
  22. def UseProp(self) -> bool:
  23. pass
  24. def UseSkill(self) -> bool:
  25. pass
  26. # 消息相关,接收消息时无消息则返回(-1, '')
  27. def SendMessage(self, toID: int, message: str) -> bool:
  28. pass
  29. def HaveMessage(self) -> bool:
  30. pass
  31. def GetMessage(self) -> tuple[int, str]:
  32. pass
  33. # 等待下一帧
  34. def Wait(self) -> bool:
  35. pass
  36. # 获取各类游戏中的消息
  37. def GetFrameCount(self) -> int:
  38. pass
  39. def GetPlayerGUIDs(self) -> List[int]:
  40. pass
  41. def GetButchers(self) -> List[THUAI6.Butcher]:
  42. pass
  43. def GetHumans(self) -> List[THUAI6.Human]:
  44. pass
  45. def GetProps(self) -> List[THUAI6.Prop]:
  46. pass
  47. def GetSelfInfo(self) -> Union[THUAI6.Human, THUAI6.Butcher]:
  48. pass
  49. def GetFullMap(self) -> List[List[THUAI6.PlaceType]]:
  50. pass
  51. def GetPlaceType(self, cellX: int, cellY: int) -> THUAI6.PlaceType:
  52. pass
  53. # 用于DEBUG的输出函数,仅在DEBUG模式下有效
  54. def PrintHuman(self) -> None:
  55. pass
  56. def PrintButcher(self) -> None:
  57. pass
  58. def PrintProp(self) -> None:
  59. pass
  60. def PrintSelfInfo(self) -> None:
  61. pass
  62. # 人类阵营的特殊函数
  63. def Escape(self) -> bool:
  64. pass
  65. def StartFixMachine(self) -> bool:
  66. pass
  67. def EndFixMachine(self) -> bool:
  68. pass
  69. def StartSaveHuman(self) -> bool:
  70. pass
  71. def EndSaveHuman(self) -> bool:
  72. pass
  73. # Timer用
  74. def StartTimer(self) -> None:
  75. pass
  76. def EndTimer(self) -> None:
  77. pass
  78. def Play(self, ai: IAI) -> None:
  79. pass
  80. class ButcherAPI(IButcherAPI, IGameTimer):
  81. # 指挥本角色进行移动,`timeInMilliseconds` 为移动时间,单位为毫秒;`angleInRadian` 表示移动的方向,单位是弧度,使用极坐标——竖直向下方向为 x 轴,水平向右方向为 y 轴
  82. def Move(self, timeInMilliseconds: int, angle: float) -> bool:
  83. pass
  84. # 向特定方向移动
  85. def MoveRight(self, timeInMilliseconds: int) -> bool:
  86. pass
  87. def MoveLeft(self, timeInMilliseconds: int) -> bool:
  88. pass
  89. def MoveUp(self, timeInMilliseconds: int) -> bool:
  90. pass
  91. def MoveDown(self, timeInMilliseconds: int) -> bool:
  92. pass
  93. # 道具和技能相关
  94. def PickProp(self, propType: THUAI6.PropType) -> bool:
  95. pass
  96. def UseProp(self) -> bool:
  97. pass
  98. def UseSkill(self) -> bool:
  99. pass
  100. # 消息相关,接收消息时无消息则返回(-1, '')
  101. def SendMessage(self, toID: int, message: str) -> bool:
  102. pass
  103. def HaveMessage(self) -> bool:
  104. pass
  105. def GetMessage(self) -> tuple[int, str]:
  106. pass
  107. # 等待下一帧
  108. def Wait(self) -> bool:
  109. pass
  110. # 获取各类游戏中的消息
  111. def GetFrameCount(self) -> int:
  112. pass
  113. def GetPlayerGUIDs(self) -> List[int]:
  114. pass
  115. def GetButchers(self) -> List[THUAI6.Butcher]:
  116. pass
  117. def GetHumans(self) -> List[THUAI6.Human]:
  118. pass
  119. def GetProps(self) -> List[THUAI6.Prop]:
  120. pass
  121. def GetSelfInfo(self) -> Union[THUAI6.Human, THUAI6.Butcher]:
  122. pass
  123. def GetFullMap(self) -> List[List[THUAI6.PlaceType]]:
  124. pass
  125. def GetPlaceType(self, cellX: int, cellY: int) -> THUAI6.PlaceType:
  126. pass
  127. # 用于DEBUG的输出函数,仅在DEBUG模式下有效
  128. def PrintHuman(self) -> None:
  129. pass
  130. def PrintButcher(self) -> None:
  131. pass
  132. def PrintProp(self) -> None:
  133. pass
  134. def PrintSelfInfo(self) -> None:
  135. pass
  136. # 屠夫阵营的特殊函数
  137. def Attack(self, angle: float) -> bool:
  138. pass
  139. def CarryHuman(self) -> bool:
  140. pass
  141. def ReleaseHuman(self) -> bool:
  142. pass
  143. def HangHuman(self) -> bool:
  144. pass
  145. # Timer用
  146. def StartTimer(self) -> None:
  147. pass
  148. def EndTimer(self) -> None:
  149. pass
  150. def Play(self, ai: IAI) -> None:
  151. pass