refactor: moved serialization into core project
This commit is contained in:
parent
791349686b
commit
fb363970fc
@ -7,4 +7,8 @@
|
||||
<RootNamespace>Syntriax.Engine.Core</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\YamlDotNet\YamlDotNet\YamlDotNet.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,5 +1,5 @@
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public interface IEngineTypeYamlConverter : IYamlTypeConverter;
|
@ -1,10 +1,12 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class BehaviourControllerConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class BehaviourConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class AABBConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class CircleConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class Line2DConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class Line2DEquationConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class Projection1DConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class QuaternionConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,11 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class Shape2DConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class TriangleConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class Vector2DConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class Vector3DConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,10 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class StateEnableConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,10 +1,12 @@
|
||||
using Syntriax.Engine.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using YamlDotNet.Core;
|
||||
using YamlDotNet.Core.Events;
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class UniverseObjectConverter : IEngineTypeYamlConverter
|
||||
{
|
@ -1,4 +1,6 @@
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
using System;
|
||||
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)]
|
||||
public class IgnoreSerializationAttribute : Attribute;
|
@ -1,4 +1,6 @@
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
using System;
|
||||
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
|
||||
public class SerializeAllAttribute : Attribute;
|
6
Engine.Core/Serialization/SerializeAttribute.cs
Normal file
6
Engine.Core/Serialization/SerializeAttribute.cs
Normal file
@ -0,0 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
|
||||
public class SerializeAttribute : Attribute;
|
@ -1,9 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using Syntriax.Engine.Core;
|
||||
using Syntriax.Engine.Core.Factory;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public class SerializedClass
|
||||
{
|
@ -1,8 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
using YamlDotNet.Serialization;
|
||||
using YamlDotNet.Serialization.NamingConventions;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
public static class Serializer
|
||||
{
|
@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
namespace Syntriax.Engine.Core.Serialization;
|
||||
|
||||
internal static class Utils
|
||||
{
|
@ -1,15 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>Syntriax.Engine.Serialization</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Engine.Core\Engine.Core.csproj" />
|
||||
<ProjectReference Include="..\YamlDotNet\YamlDotNet\YamlDotNet.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,4 +0,0 @@
|
||||
namespace Syntriax.Engine.Serialization;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class SerializeAttribute : Attribute;
|
12
Engine.sln
12
Engine.sln
@ -11,8 +11,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Systems", "Engine.Sy
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine", "Engine\Engine.csproj", "{58AE79C1-9203-44AE-8022-AA180F0A71DC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Engine.Serialization", "Engine.Serialization\Engine.Serialization.csproj", "{9B46BE51-DD6B-4EDD-AAA8-41E993D7422C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YamlDotNet", "YamlDotNet\YamlDotNet\YamlDotNet.csproj", "{4C4906EB-0210-493E-A7D0-7DEBDF2969E8}"
|
||||
EndProject
|
||||
Global
|
||||
@ -20,9 +18,6 @@ Global
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{71719EAD-1B6B-4229-B39E-E53A2E8BFAB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{71719EAD-1B6B-4229-B39E-E53A2E8BFAB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
@ -40,13 +35,12 @@ Global
|
||||
{58AE79C1-9203-44AE-8022-AA180F0A71DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{58AE79C1-9203-44AE-8022-AA180F0A71DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{58AE79C1-9203-44AE-8022-AA180F0A71DC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9B46BE51-DD6B-4EDD-AAA8-41E993D7422C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9B46BE51-DD6B-4EDD-AAA8-41E993D7422C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9B46BE51-DD6B-4EDD-AAA8-41E993D7422C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9B46BE51-DD6B-4EDD-AAA8-41E993D7422C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4C4906EB-0210-493E-A7D0-7DEBDF2969E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4C4906EB-0210-493E-A7D0-7DEBDF2969E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4C4906EB-0210-493E-A7D0-7DEBDF2969E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4C4906EB-0210-493E-A7D0-7DEBDF2969E8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
Loading…
x
Reference in New Issue
Block a user