Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hhzzff authored May 11, 2024
2 parents acca3a7 + 5fa8518 commit af69666
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 41 deletions.
2 changes: 1 addition & 1 deletion CAPI/cpp/API/src/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ std::future<bool> ShipAPI::Construct(THUAI7::ConstructionType constructionType)
bool ShipAPI::HaveView(int32_t targetX, int32_t targetY) const
{
auto selfInfo = GetSelfInfo();
return logic.HaveView(targetX, targetY, selfInfo->x, selfInfo->y, selfInfo->viewRange);
return logic.HaveView(selfInfo->x, selfInfo->y, targetX, targetY, selfInfo->viewRange);
}

// Team独有
Expand Down
2 changes: 1 addition & 1 deletion CAPI/cpp/API/src/DebugAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ std::shared_ptr<const THUAI7::Ship> ShipDebugAPI::GetSelfInfo() const
bool ShipDebugAPI::HaveView(int32_t targetX, int32_t targetY) const
{
auto selfInfo = GetSelfInfo();
return logic.HaveView(targetX, targetY, selfInfo->x, selfInfo->y, selfInfo->viewRange);
return logic.HaveView(selfInfo->x, selfInfo->y, targetX, targetY, selfInfo->viewRange);
}

int32_t ShipDebugAPI::GetEnergy() const
Expand Down
14 changes: 7 additions & 7 deletions CAPI/python/PyAPI/API.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def __init__(self, logic: ILogic) -> None:
self.__logic = logic
self.__pool = ThreadPoolExecutor(20)

def Move(self, timeInMilliseconds: int, angle: float) -> Future[bool]:
return self.__pool.submit(self.__logic.Move, timeInMilliseconds, angle)
def Move(self, timeInMilliseconds: int, angleInRadian: float) -> Future[bool]:
return self.__pool.submit(self.__logic.Move, timeInMilliseconds, angleInRadian)

def MoveRight(self, timeInMilliseconds: int) -> Future[bool]:
return self.Move(timeInMilliseconds, pi * 0.5)
Expand All @@ -25,8 +25,8 @@ def MoveUp(self, timeInMilliseconds: int) -> Future[bool]:
def MoveDown(self, timeInMilliseconds: int) -> Future[bool]:
return self.Move(timeInMilliseconds, 0)

def Attack(self, angle: float) -> Future[bool]:
return self.__pool.submit(self.__logic.Attack, angle)
def Attack(self, angleInRadian: float) -> Future[bool]:
return self.__pool.submit(self.__logic.Attack, angleInRadian)

def Recover(self, recover: int) -> Future[bool]:
return self.__pool.submit(self.__logic.Recover, recover)
Expand Down Expand Up @@ -76,7 +76,7 @@ def GetFullMap(self) -> List[List[THUAI7.PlaceType]]:
def GetPlaceType(self, cellX: int, cellY: int) -> THUAI7.PlaceType:
return self.__logic.GetPlaceType(cellX, cellY)

def GetConstructionState(self, cellX: int, cellY: int) -> tuple:
def GetConstructionState(self, cellX: int, cellY: int) -> Tuple[int, int]:
return self.__logic.GetConstructionState(cellX, cellY)

def GetWormholeHp(self, cellX: int, cellY: int) -> int:
Expand Down Expand Up @@ -112,7 +112,7 @@ def HaveView(self, gridX: int, gridY: int) -> bool:
self.GetSelfInfo().viewRange,
)

def Print(self, cont: str) -> None:
def Print(self, string: str) -> None:
pass

def PrintShip(self) -> None:
Expand Down Expand Up @@ -184,7 +184,7 @@ def GetFullMap(self) -> List[List[THUAI7.PlaceType]]:
def GetPlaceType(self, cellX: int, cellY: int) -> THUAI7.PlaceType:
return self.__logic.GetPlaceType(cellX, cellY)

def GetConstructionState(self, cellX: int, cellY: int) -> tuple:
def GetConstructionState(self, cellX: int, cellY: int) -> Tuple[int, int]:
return self.__logic.GetConstructionState(cellX, cellY)

def GetWormholeHp(self, cellX: int, cellY: int) -> int:
Expand Down
8 changes: 4 additions & 4 deletions CAPI/python/PyAPI/DebugAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def GetFullMap(self) -> List[List[THUAI7.PlaceType]]:
def GetPlaceType(self, cellX: int, cellY: int) -> THUAI7.PlaceType:
return self.__logic.GetPlaceType(cellX, cellY)

def GetConstructionState(self, cellX: int, cellY: int) -> tuple:
def GetConstructionState(self, cellX: int, cellY: int) -> Tuple[int, int]:
return self.__logic.GetConstructionState(cellX, cellY)

def GetWormholeHp(self, cellX: int, cellY: int) -> int:
Expand Down Expand Up @@ -235,8 +235,8 @@ def HaveView(self, gridX: int, gridY: int) -> bool:
self.GetSelfInfo().viewRange,
)

def Print(self, cont: str) -> None:
self.__logger.info(cont)
def Print(self, string: str) -> None:
self.__logger.info(string)

def PrintShip(self) -> None:
for ship in self.__logic.GetShips():
Expand Down Expand Up @@ -440,7 +440,7 @@ def GetFullMap(self) -> List[List[THUAI7.PlaceType]]:
def GetPlaceType(self, cellX: int, cellY: int) -> THUAI7.PlaceType:
return self.__logic.GetPlaceType(cellX, cellY)

def GetConstructionState(self, cellX: int, cellY: int) -> tuple:
def GetConstructionState(self, cellX: int, cellY: int) -> Tuple[int, int]:
return self.__logic.GetConstructionState(cellX, cellY)

def GetWormholeHp(self, cellX: int, cellY: int) -> int:
Expand Down
Loading

0 comments on commit af69666

Please sign in to comment.