diff --git a/logic/Client/App.xaml b/logic/Client/App.xaml new file mode 100644 index 00000000..e17b2ec6 --- /dev/null +++ b/logic/Client/App.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/logic/Client/App.xaml.cs b/logic/Client/App.xaml.cs new file mode 100644 index 00000000..c5b7641f --- /dev/null +++ b/logic/Client/App.xaml.cs @@ -0,0 +1,11 @@ +namespace Client +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + MainPage = new AppShell(); + } + } +} \ No newline at end of file diff --git a/logic/Client/AppShell.xaml b/logic/Client/AppShell.xaml new file mode 100644 index 00000000..0d2a4a5d --- /dev/null +++ b/logic/Client/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/logic/Client/AppShell.xaml.cs b/logic/Client/AppShell.xaml.cs new file mode 100644 index 00000000..942d305b --- /dev/null +++ b/logic/Client/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace Client +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/logic/Client/Client.csproj b/logic/Client/Client.csproj index 02642032..d336e982 100644 --- a/logic/Client/Client.csproj +++ b/logic/Client/Client.csproj @@ -1,33 +1,97 @@ - - - - WinExe - net6.0-windows - enable - true - eesast_software_trans_enlarged.ico - - - - - - - - - - - - - - - - - - - - - - - - - + + + + net7.0-android;net7.0-ios;net7.0-maccatalyst + $(TargetFrameworks);net7.0-windows10.0.19041.0 + + + Exe + Client + true + true + enable + + + Client + + + com.companyname.client + 872eca96-e290-4365-952b-f5e5b16e7217 + + + 1.0 + 1 + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + MainPage.xaml + + + Map.xaml + + + GameStatusBar.xaml + + + PlayerStatusBar.xaml + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + + + + + + diff --git a/logic/Client/Client.sln b/logic/Client/Client.sln index aedf36b1..9020b267 100644 --- a/logic/Client/Client.sln +++ b/logic/Client/Client.sln @@ -1,37 +1,33 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.1.32328.378 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client.csproj", "{5AD8481D-90EF-410C-BD48-355DB97EEAB3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Playback", "..\..\playback\Playback\Playback.csproj", "{662FDB27-FBF3-4D2D-BDA4-B4BF4D35B866}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Protos", "..\..\dependency\proto\Protos.csproj", "{A0F72D3B-9A82-48EB-90AF-B3770151AD83}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5AD8481D-90EF-410C-BD48-355DB97EEAB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5AD8481D-90EF-410C-BD48-355DB97EEAB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5AD8481D-90EF-410C-BD48-355DB97EEAB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5AD8481D-90EF-410C-BD48-355DB97EEAB3}.Release|Any CPU.Build.0 = Release|Any CPU - {662FDB27-FBF3-4D2D-BDA4-B4BF4D35B866}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {662FDB27-FBF3-4D2D-BDA4-B4BF4D35B866}.Debug|Any CPU.Build.0 = Debug|Any CPU - {662FDB27-FBF3-4D2D-BDA4-B4BF4D35B866}.Release|Any CPU.ActiveCfg = Release|Any CPU - {662FDB27-FBF3-4D2D-BDA4-B4BF4D35B866}.Release|Any CPU.Build.0 = Release|Any CPU - {A0F72D3B-9A82-48EB-90AF-B3770151AD83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A0F72D3B-9A82-48EB-90AF-B3770151AD83}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A0F72D3B-9A82-48EB-90AF-B3770151AD83}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A0F72D3B-9A82-48EB-90AF-B3770151AD83}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {89A74B1B-445C-49EB-9C93-506DC243C227} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34202.233 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "Client.csproj", "{F75BC602-8C64-4645-9C9A-2DF71085C52C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Protos", "..\..\dependency\proto\Protos.csproj", "{DAE45955-E55C-4E11-80B4-E7EC77E11C89}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F75BC602-8C64-4645-9C9A-2DF71085C52C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F75BC602-8C64-4645-9C9A-2DF71085C52C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F75BC602-8C64-4645-9C9A-2DF71085C52C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {F75BC602-8C64-4645-9C9A-2DF71085C52C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F75BC602-8C64-4645-9C9A-2DF71085C52C}.Release|Any CPU.Build.0 = Release|Any CPU + {F75BC602-8C64-4645-9C9A-2DF71085C52C}.Release|Any CPU.Deploy.0 = Release|Any CPU + {DAE45955-E55C-4E11-80B4-E7EC77E11C89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DAE45955-E55C-4E11-80B4-E7EC77E11C89}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DAE45955-E55C-4E11-80B4-E7EC77E11C89}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DAE45955-E55C-4E11-80B4-E7EC77E11C89}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4C1CF739-9F04-4B0F-B148-BCC1629AACE7} + EndGlobalSection +EndGlobal diff --git a/logic/Client/GameStatusBar.xaml b/logic/Client/GameStatusBar.xaml new file mode 100644 index 00000000..1a7b3139 --- /dev/null +++ b/logic/Client/GameStatusBar.xaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/logic/Client/GameStatusBar.xaml.cs b/logic/Client/GameStatusBar.xaml.cs new file mode 100644 index 00000000..974f97cc --- /dev/null +++ b/logic/Client/GameStatusBar.xaml.cs @@ -0,0 +1,58 @@ +using Protobuf; + +namespace Client; + +public partial class GameStatusBar : ContentView +{ + private readonly int lengthOfHp1Slide; + private readonly int lengthOfHp2Slide; + private readonly int lengthOfHp3Slide; + private readonly int WormHoleFullHp = 18000; + public GameStatusBar(Grid parent, int Row, int Column) + { + InitializeComponent(); + parent.Children.Add(this); + parent.SetColumn(this, Column); + parent.SetRow(this, Row); + parent.SetRowSpan(this, 2); + } + public void SetWormHoleValue(MessageOfBuilding wormholeMsg) + { + if (wormholeMsg.BuildingType != BuildingType.Wormhole) + { + return; + } + switch (wormholeMsg.BuildingId) + { + case 0: + WormHole1HpSlide.WidthRequest = wormholeMsg.Hp / WormHoleFullHp * lengthOfHp1Slide; + break; + case 1: + WormHole2HpSlide.WidthRequest = wormholeMsg.Hp / WormHoleFullHp * lengthOfHp2Slide; + break; + case 2: + WormHole3HpSlide.WidthRequest = wormholeMsg.Hp / WormHoleFullHp * lengthOfHp3Slide; + break; + } + } + + public void SetGameTimeValue(MessageOfAll obj) + { + int min, sec; + sec = obj.GameTime / 1000; + min = sec / 60; + sec = sec % 60; + GameTime.Text = "时间:"; + if (min / 10 == 0) + { + GameTime.Text += "0"; + } + GameTime.Text += min.ToString() + ":"; + if (sec / 10 == 0) + { + GameTime.Text += "0"; + } + GameTime.Text += sec.ToString(); + } + +} \ No newline at end of file diff --git a/logic/Client/Logo.png b/logic/Client/Logo.png deleted file mode 100644 index 6d7d5114..00000000 Binary files a/logic/Client/Logo.png and /dev/null differ diff --git a/logic/Client/MainPage.xaml b/logic/Client/MainPage.xaml new file mode 100644 index 00000000..b9589a7a --- /dev/null +++ b/logic/Client/MainPage.xaml @@ -0,0 +1,153 @@ + + + + + + + + + + + +