diff --git a/src/Artemis.Core/Plugins/Modules/DataModel.cs b/src/Artemis.Core/Plugins/Modules/DataModel.cs index 1321b705a..57bd563bd 100644 --- a/src/Artemis.Core/Plugins/Modules/DataModel.cs +++ b/src/Artemis.Core/Plugins/Modules/DataModel.cs @@ -1,10 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; -using Artemis.Core.Modules; using Humanizer; using Newtonsoft.Json; using Module = Artemis.Core.Modules.Module; @@ -16,6 +15,7 @@ namespace Artemis.Core.DataModelExpansions /// public abstract class DataModel { + private readonly List _activePaths = new(); private readonly Dictionary _dynamicChildren = new(); /// @@ -54,6 +54,11 @@ namespace Artemis.Core.DataModelExpansions [DataModelIgnore] public ReadOnlyDictionary DynamicChildren => new(_dynamicChildren); + /// + /// Gets a read-only list of s targeting this data model + /// + public ReadOnlyCollection ActivePaths => _activePaths.AsReadOnly(); + /// /// Returns a read-only collection of all properties in this datamodel that are to be ignored /// @@ -277,5 +282,20 @@ namespace Artemis.Core.DataModelExpansions } #endregion + + #region Paths + + internal void AddDataModelPath(DataModelPath path) + { + if (!_activePaths.Contains(path)) + _activePaths.Add(path); + } + + internal void RemoveDataModelPath(DataModelPath path) + { + _activePaths.Remove(path); + } + + #endregion } } \ No newline at end of file