From a19e754f7c60a9b51b62025a5d3468fc1e974cea Mon Sep 17 00:00:00 2001 From: SpoinkyNL Date: Tue, 29 Sep 2020 21:56:40 +0200 Subject: [PATCH] Dynamic datamodels - Added some required models --- .../Artemis.Core.csproj.DotSettings | 1 + .../Models/Profile/DataModel/DataModelPath.cs | 32 +++++++++++++++++++ .../Profile/DataModel/DataModelPathPart.cs | 18 +++++++++++ .../DataModel/DataModelPathPartType.cs | 18 +++++++++++ 4 files changed, 69 insertions(+) create mode 100644 src/Artemis.Core/Models/Profile/DataModel/DataModelPath.cs create mode 100644 src/Artemis.Core/Models/Profile/DataModel/DataModelPathPart.cs create mode 100644 src/Artemis.Core/Models/Profile/DataModel/DataModelPathPartType.cs diff --git a/src/Artemis.Core/Artemis.Core.csproj.DotSettings b/src/Artemis.Core/Artemis.Core.csproj.DotSettings index 24a752160..280c5c5d3 100644 --- a/src/Artemis.Core/Artemis.Core.csproj.DotSettings +++ b/src/Artemis.Core/Artemis.Core.csproj.DotSettings @@ -32,6 +32,7 @@ True True True + True True True True diff --git a/src/Artemis.Core/Models/Profile/DataModel/DataModelPath.cs b/src/Artemis.Core/Models/Profile/DataModel/DataModelPath.cs new file mode 100644 index 000000000..0cce661d3 --- /dev/null +++ b/src/Artemis.Core/Models/Profile/DataModel/DataModelPath.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Artemis.Core.DataModelExpansions; + +namespace Artemis.Core +{ + /// + /// Represents a path that points to a property in data model + /// + public class DataModelPath + { + private readonly LinkedList _parts; + + internal DataModelPath() + { + _parts = new LinkedList(); + } + + /// + /// Gets the data model at which this path starts + /// + public DataModel DataModel { get; private set; } + + /// + /// Gets a read-only list of all parts of this path + /// + public IReadOnlyCollection Parts => _parts.ToList().AsReadOnly(); + + internal Guid DataModelGuid { get; set; } + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/DataModel/DataModelPathPart.cs b/src/Artemis.Core/Models/Profile/DataModel/DataModelPathPart.cs new file mode 100644 index 000000000..8711f41dd --- /dev/null +++ b/src/Artemis.Core/Models/Profile/DataModel/DataModelPathPart.cs @@ -0,0 +1,18 @@ +namespace Artemis.Core +{ + /// + /// Represents a part of a data model path + /// + public class DataModelPathPart + { + /// + /// Gets the identifier that is associated with this part + /// + public string Identifier { get; private set; } + + /// + /// Gets the type of data model this part of the path points to + /// + public DataModelPathPartType Type { get; private set; } + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/DataModel/DataModelPathPartType.cs b/src/Artemis.Core/Models/Profile/DataModel/DataModelPathPartType.cs new file mode 100644 index 000000000..e922ba5b3 --- /dev/null +++ b/src/Artemis.Core/Models/Profile/DataModel/DataModelPathPartType.cs @@ -0,0 +1,18 @@ +namespace Artemis.Core +{ + /// + /// Represents a type of data model path + /// + public enum DataModelPathPartType + { + /// + /// Represents a static data model type that points to a data model defined in code + /// + Static, + + /// + /// Represents a static data model type that points to a data model defined at runtime + /// + Dynamic + } +} \ No newline at end of file