Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/DreamEnderKing/THUAI7 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamEnderKing committed May 11, 2024
2 parents 1caaf4f + 1f5815a commit dc8b434
Show file tree
Hide file tree
Showing 12 changed files with 344 additions and 107 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: deploy
on:
push:
branches: [dev, main, master]
pull_request:
branches: [dev, main, master]

env:
version: 1.1.0.0

jobs:
deploy-to-tencent-cos:
Expand All @@ -24,6 +29,8 @@ jobs:
mkdir D:\a\publish
- name: Copy THUAI7
run: Copy-Item -recurse D:\a\THUAI7\THUAI7\ D:\a\mirror\
- name: Test
run: tree D:\a\mirror
- name: Remove directories not needed
run: |
Remove-Item -recurse -force D:\a\mirror\.git
Expand All @@ -38,8 +45,15 @@ jobs:
- name: Build Client
run: dotnet publish "./logic/Client/Client.csproj" -o "D:\a\mirror\logic\Client" -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true
- name: Deploy to bucket
run: dotnet run --project "./dependency/deploy/deploy.csproj" ${{ secrets.INSTALLER_COS_SECRET_ID }} ${{ secrets.INSTALLER_COS_SECRET_KEY }} "check"
- name: Delpoy installer package
run: dotnet run --project "./dependency/deploy/deploy.csproj" ${{ secrets.INSTALLER_COS_SECRET_ID }} ${{ secrets.INSTALLER_COS_SECRET_KEY }}
- name: Get installer package(No Key contained for safety)
run: |
dotnet publish "./installer/installer.csproj" -o "D:\a\publish" -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true
dotnet run --project "./dependency/deploy/deploy.csproj" ${{ secrets.INSTALLER_COS_SECRET_ID }} ${{ secrets.INSTALLER_COS_SECRET_KEY }} "upload"
$version=Get-ChildItem -Path D:\a\publish | ForEach-Object { $_.name }
[Environment]::SetEnvironmentVariable("version", $version, "Machine")
dotnet publish "./installer/installer.csproj" -o "D:\a\installer" -f net8.0-windows10.0.19041.0 -c Release -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true
./dependency/7z/7za.exe a -r D:\a\publish\Installer_v${version}.zip D:\a\installer\*
- name: Upload installer package
uses: actions/upload-artifact@v4
with:
name: Installer_v${{ env.version }}.zip
path: D:\a\publish\Installer_v${{ env.version }}.zip
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 dc8b434

Please sign in to comment.