-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Panxuc/dev
feat: basic structure of logic
- Loading branch information
Showing
83 changed files
with
5,132 additions
and
68 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32328.378 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proto", "Proto.csproj", "{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {CB1C0B2E-5D0E-4420-94B5-FE8AECC7E106} | ||
EndGlobalSection | ||
EndGlobal | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32328.378 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Proto", "Proto.csproj", "{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B9A3CDD7-7852-4220-A2AA-2B986E0C19E8}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {CB1C0B2E-5D0E-4420-94B5-FE8AECC7E106} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<!--<ItemGroup> | ||
<None Remove="Message2Clients.proto" /> | ||
<None Remove="Message2Server.proto" /> | ||
<None Remove="MessageType.proto" /> | ||
<None Remove="Services.proto" /> | ||
</ItemGroup>--> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Google.Protobuf" Version="3.23.3" /> | ||
<PackageReference Include="Google.Protobuf.Tools" Version="3.24.4" /> | ||
<PackageReference Include="Grpc" Version="2.46.6" /> | ||
<PackageReference Include="Grpc.Core" Version="2.46.6" /> | ||
<PackageReference Include="Grpc.Tools" Version="2.54.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Protobuf Include="Message2Clients.proto" /> | ||
<Protobuf Include="Message2Server.proto" /> | ||
<Protobuf Include="MessageType.proto" /> | ||
<Protobuf Include="Services.proto" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<!--<ItemGroup> | ||
<None Remove="Message2Clients.proto" /> | ||
<None Remove="Message2Server.proto" /> | ||
<None Remove="MessageType.proto" /> | ||
<None Remove="Services.proto" /> | ||
</ItemGroup>--> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Google.Protobuf" Version="3.23.3" /> | ||
<PackageReference Include="Google.Protobuf.Tools" Version="3.24.4" /> | ||
<PackageReference Include="Grpc" Version="2.46.6" /> | ||
<PackageReference Include="Grpc.Core" Version="2.46.6" /> | ||
<PackageReference Include="Grpc.Tools" Version="2.54.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Protobuf Include="Message2Clients.proto" /> | ||
<Protobuf Include="Message2Server.proto" /> | ||
<Protobuf Include="MessageType.proto" /> | ||
<Protobuf Include="Services.proto" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[InternetShortcut] | ||
URL=https://thuai7.panxuc.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Preparation.Utility; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public static class AreaFactory | ||
{ | ||
public static Immovable GetArea(XY pos, PlaceType placeType) => placeType switch | ||
{ | ||
PlaceType.Home => new Home(pos), | ||
PlaceType.Ruin => new Ruin(pos), | ||
PlaceType.Shadow => new Shadow(pos), | ||
PlaceType.Asteroid => new Asteroid(pos), | ||
PlaceType.Resource => new Resource(pos), | ||
PlaceType.Construction => new Construction(pos), | ||
PlaceType.Wormhole => new Wormhole(pos), | ||
_ => throw new System.NotImplementedException() | ||
}; | ||
public static OutOfBoundBlock GetOutOfBoundBlock(XY pos) => new(pos); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Preparation.Utility; | ||
using System; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public class Asteroid : Immovable | ||
{ | ||
public override bool IsRigid => true; | ||
public override ShapeType Shape => ShapeType.Square; | ||
public Asteroid(XY initPos) | ||
: base(initPos, GameData.NumOfPosGridPerCell / 2, GameObjType.Asteroid) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Preparation.Utility; | ||
using System; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public class Construction : Immovable | ||
{ | ||
public LongWithVariableRange HP => throw new NotImplementedException(); | ||
public override bool IsRigid => constructionType == ConstructionType.Community; | ||
public override ShapeType Shape => ShapeType.Square; | ||
private ConstructionType constructionType = ConstructionType.Null; | ||
public ConstructionType ConstructionType => constructionType; | ||
public Construction(XY initPos) | ||
: base(initPos, GameData.NumOfPosGridPerCell / 2, GameObjType.Construction) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Preparation.Interface; | ||
using Preparation.Utility; | ||
using System; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public class Home : Immovable, IHome | ||
{ | ||
public AtomicLong TeamID => throw new NotImplementedException(); | ||
public LongWithVariableRange HP => throw new NotImplementedException(); | ||
public long Score => throw new NotImplementedException(); | ||
public override bool IsRigid => false; | ||
public override ShapeType Shape => ShapeType.Square; | ||
public void AddScore(long add) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
public Home(XY initPos) | ||
: base(initPos, GameData.NumOfPosGridPerCell / 2, GameObjType.Home) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Preparation.Interface; | ||
using Preparation.Utility; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
/// <summary> | ||
/// 逻辑墙 | ||
/// </summary> | ||
public class OutOfBoundBlock : Immovable, IOutOfBound | ||
{ | ||
public override bool IsRigid => true; | ||
public override ShapeType Shape => ShapeType.Square; | ||
public OutOfBoundBlock(XY initPos) | ||
: base(initPos, int.MaxValue, GameObjType.OutOfBoundBlock) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Preparation.Utility; | ||
using System; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public class Resource : Immovable | ||
{ | ||
public override bool IsRigid => true; | ||
public override ShapeType Shape => ShapeType.Square; | ||
public Resource(XY initPos) | ||
: base(initPos, GameData.NumOfPosGridPerCell / 2, GameObjType.Resource) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Preparation.Utility; | ||
using System; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public class Ruin : Immovable | ||
{ | ||
public override bool IsRigid => true; | ||
public override ShapeType Shape => ShapeType.Square; | ||
public Ruin(XY initPos) | ||
: base(initPos, GameData.NumOfPosGridPerCell / 2, GameObjType.Ruin) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Preparation.Utility; | ||
using System; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public class Shadow : Immovable | ||
{ | ||
public override bool IsRigid => false; | ||
public override ShapeType Shape => ShapeType.Square; | ||
public Shadow(XY initPos) | ||
: base(initPos, GameData.NumOfPosGridPerCell / 2, GameObjType.Shadow) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Preparation.Interface; | ||
using Preparation.Utility; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace GameClass.GameObj.Areas; | ||
|
||
public class Wormhole : Immovable, IWormhole | ||
{ | ||
public LongWithVariableRange HP => throw new NotImplementedException(); | ||
public List<XY> Entrance => throw new NotImplementedException(); | ||
public List<XY> Content => throw new NotImplementedException(); | ||
public override bool IsRigid => HP > GameData.WormholeHP / 2; | ||
public override ShapeType Shape => ShapeType.Square; | ||
public Wormhole(XY initPos) | ||
: base(initPos, GameData.NumOfPosGridPerCell / 2, GameObjType.Wormhole) | ||
{ | ||
} | ||
} |
Oops, something went wrong.