refactor(architecture): 重构项目结构并移除抽象层

- 移除 GFramework.Godot.Abstractions 项目及其所有配置文件
- 将抽象接口直接合并到 GFramework.Godot 项目中
- 更新项目引用关系,移除不必要的抽象层依赖
- 调整命名空间引用,统一使用 GFramework.Godot.architecture
- 简化模块参数命名,提升代码可读性
- 更新解决方案配置,移除已删除的项目配置
This commit is contained in:
GwWuYou 2025-12-28 13:34:20 +08:00
parent 7299126a18
commit 00704b7ec2
12 changed files with 12 additions and 70 deletions

View File

@ -11,7 +11,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj" PrivateAssets="all"/> <ProjectReference Include="..\GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj"/>
</ItemGroup> </ItemGroup>
<!-- 引入必要的命名空间 --> <!-- 引入必要的命名空间 -->
<ItemGroup> <ItemGroup>

View File

@ -1,24 +0,0 @@
<Project>
<!-- import parent: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build -->
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!--
we use a higher version than supported by the target framework to have nullable types and other nice features
(a lot of features get polyfilled by Meziantou.Polyfill)
however we need to be careful with the available features!
-->
<LangVersion>preview</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meziantou.Analyzer" Version="2.0.264">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Meziantou.Polyfill" Version="1.0.71">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
配置项目构建属性
设置项目不可打包、生成文档文件并包含特定的Polyfill
-->
<PropertyGroup>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<MeziantouPolyfill_IncludedPolyfills>T:System.Diagnostics.CodeAnalysis.NotNullWhenAttribute</MeziantouPolyfill_IncludedPolyfills>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Godot.SourceGenerators" Version="4.5.1" PrivateAssets="all"/>
<PackageReference Include="GodotSharpEditor" Version="4.5.1" PrivateAssets="all"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj" PrivateAssets="all"/>
<ProjectReference Include="..\GFramework.Game.Abstractions\GFramework.Game.Abstractions.csproj" PrivateAssets="all"/>
</ItemGroup>
<!-- 引入必要的命名空间 -->
<ItemGroup>
<Using Include="GFramework.Godot.Abstractions"/>
</ItemGroup>
</Project>

View File

@ -14,9 +14,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\GFramework.Game.Abstractions\GFramework.Game.Abstractions.csproj"/>
<ProjectReference Include="..\GFramework.Game\GFramework.Game.csproj"/> <ProjectReference Include="..\GFramework.Game\GFramework.Game.csproj"/>
<ProjectReference Include="..\GFramework.Godot.Abstractions\GFramework.Godot.Abstractions.csproj"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="extensions\ControlExtensions.cs"/> <Compile Remove="extensions\ControlExtensions.cs"/>

View File

@ -1,6 +1,5 @@
using GFramework.Core.architecture; using GFramework.Core.architecture;
using GFramework.Core.constants; using GFramework.Core.constants;
using GFramework.Godot.Abstractions.architecture;
using GFramework.Godot.extensions; using GFramework.Godot.extensions;
using Godot; using Godot;

View File

@ -1,6 +1,5 @@
using GFramework.Core.Abstractions.architecture; using GFramework.Core.Abstractions.architecture;
using GFramework.Core.architecture; using GFramework.Core.architecture;
using GFramework.Godot.Abstractions.architecture;
using Godot; using Godot;
namespace GFramework.Godot.architecture; namespace GFramework.Godot.architecture;
@ -19,8 +18,8 @@ public abstract class AbstractGodotModule : IGodotModule
/// 当架构阶段发生变化时调用此方法 /// 当架构阶段发生变化时调用此方法
/// </summary> /// </summary>
/// <param name="phase">当前的架构阶段</param> /// <param name="phase">当前的架构阶段</param>
/// <param name="arch">架构实例</param> /// <param name="architecture">架构实例</param>
public virtual void OnPhase(ArchitecturePhase phase, IArchitecture arch) public virtual void OnPhase(ArchitecturePhase phase, IArchitecture architecture)
{ {
} }

View File

@ -1,6 +1,8 @@
using GFramework.Core.Abstractions.architecture; using GFramework.Core.Abstractions.architecture;
using GFramework.Core.architecture;
using Godot;
namespace GFramework.Godot.Abstractions.architecture; namespace GFramework.Godot.architecture;
/// <summary> /// <summary>
/// Godot模块接口定义了Godot引擎中模块的基本行为和属性 /// Godot模块接口定义了Godot引擎中模块的基本行为和属性

View File

@ -1,6 +1,6 @@
using GFramework.Core.Abstractions.architecture; using GFramework.Core.Abstractions.architecture;
using GFramework.Core.system; using GFramework.Core.system;
using GFramework.Game.assets; using GFramework.Game.Abstractions.assets;
using GFramework.Godot.Abstractions.assets; using GFramework.Godot.Abstractions.assets;
using Godot; using Godot;

View File

@ -1,7 +1,6 @@
using System; using GFramework.Core.Abstractions.system;
using System.Collections.Generic;
using GFramework.Core.Abstractions.system;
using GFramework.Game.Abstractions.assets; using GFramework.Game.Abstractions.assets;
using Godot;
namespace GFramework.Godot.Abstractions.assets; namespace GFramework.Godot.Abstractions.assets;

View File

@ -1,7 +1,6 @@
using GFramework.Core.system; using GFramework.Core.system;
using GFramework.Game.assets; using GFramework.Game.Abstractions.assets;
using GFramework.Godot.Abstractions.assets; using GFramework.Godot.Abstractions.assets;
using GFramework.Godot.Abstractions.system;
using Godot; using Godot;
namespace GFramework.Godot.system; namespace GFramework.Godot.system;

View File

@ -1,6 +1,7 @@
using GFramework.Core.Abstractions.system; using GFramework.Core.Abstractions.system;
using Godot;
namespace GFramework.Godot.Abstractions.system; namespace GFramework.Godot.system;
/// <summary> /// <summary>
/// 音频管理器系统接口,用于统一管理背景音乐和音效的播放 /// 音频管理器系统接口,用于统一管理背景音乐和音效的播放

View File

@ -22,8 +22,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.SourceGenerators
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Core.Abstractions", "GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj", "{31BA9F62-153A-4943-A8A0-7571FC7D5FEE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Core.Abstractions", "GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj", "{31BA9F62-153A-4943-A8A0-7571FC7D5FEE}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Godot.Abstractions", "GFramework.Godot.Abstractions\GFramework.Godot.Abstractions.csproj", "{EFE2EF31-CEAC-4BFD-851B-5E00FEBC945D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Game.Abstractions", "GFramework.Game.Abstractions\GFramework.Game.Abstractions.csproj", "{E20DBA4C-CEB9-4184-B614-5A99A9AE4472}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GFramework.Game.Abstractions", "GFramework.Game.Abstractions\GFramework.Game.Abstractions.csproj", "{E20DBA4C-CEB9-4184-B614-5A99A9AE4472}"
EndProject EndProject
Global Global
@ -76,10 +74,6 @@ Global
{31BA9F62-153A-4943-A8A0-7571FC7D5FEE}.Debug|Any CPU.Build.0 = Debug|Any CPU {31BA9F62-153A-4943-A8A0-7571FC7D5FEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31BA9F62-153A-4943-A8A0-7571FC7D5FEE}.Release|Any CPU.ActiveCfg = Release|Any CPU {31BA9F62-153A-4943-A8A0-7571FC7D5FEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31BA9F62-153A-4943-A8A0-7571FC7D5FEE}.Release|Any CPU.Build.0 = Release|Any CPU {31BA9F62-153A-4943-A8A0-7571FC7D5FEE}.Release|Any CPU.Build.0 = Release|Any CPU
{EFE2EF31-CEAC-4BFD-851B-5E00FEBC945D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EFE2EF31-CEAC-4BFD-851B-5E00FEBC945D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFE2EF31-CEAC-4BFD-851B-5E00FEBC945D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFE2EF31-CEAC-4BFD-851B-5E00FEBC945D}.Release|Any CPU.Build.0 = Release|Any CPU
{E20DBA4C-CEB9-4184-B614-5A99A9AE4472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E20DBA4C-CEB9-4184-B614-5A99A9AE4472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E20DBA4C-CEB9-4184-B614-5A99A9AE4472}.Debug|Any CPU.Build.0 = Debug|Any CPU {E20DBA4C-CEB9-4184-B614-5A99A9AE4472}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E20DBA4C-CEB9-4184-B614-5A99A9AE4472}.Release|Any CPU.ActiveCfg = Release|Any CPU {E20DBA4C-CEB9-4184-B614-5A99A9AE4472}.Release|Any CPU.ActiveCfg = Release|Any CPU