Skip to content

Commit

Permalink
Merge pull request #362 from eesast/dev
Browse files Browse the repository at this point in the history
v1.0.6
  • Loading branch information
DragonAura authored May 11, 2024
2 parents 350ee48 + 5fa8518 commit 581b906
Show file tree
Hide file tree
Showing 40 changed files with 1,118 additions and 319 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/debug.yml.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup dotnet-script
run: dotnet tool install --global dotnet-script
- name: Pre-Process
run: dotnet script .github/preProcess/MauiEnvConfig.csx
- name: Install Workloads
run: dotnet workload install maui-windows
- name: Create Folders need
run: |
mkdir D:\a\installer
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
Remove-Item -recurse D:\a\mirror\.github
Remove-Item -recurse D:\a\mirror\installer
Remove-Item -recurse D:\a\mirror\interface
Remove-Item -recurse D:\a\mirror\logic
- name: Build Server
run: |
mkdir D:\a\mirror\logic
dotnet build "./logic/Server/Server.csproj" -o "D:\a\mirror\logic\Server" -p:WindowsAppSDKSelfContained=true -c Release
- 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 }}
- name: Get installer package(No Key contained for safety)
run: |
$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
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 581b906

Please sign in to comment.