From c21acf87a7655c14cae3bda07da835106812955b Mon Sep 17 00:00:00 2001 From: Robert Date: Sat, 25 Sep 2021 21:35:54 +0200 Subject: [PATCH] Nodes - Added XML docs for remaining types Nodes - Fully implemented nullable reference types --- .../Extensions/IEnumerableExtensions.cs | 8 ++ .../Profile/Conditions/EventCondition.cs | 5 +- .../Profile/Conditions/StaticCondition.cs | 8 +- .../Profile/DataModel/IDataModelEvent.cs | 2 +- src/Artemis.Core/Models/Profile/Timeline.cs | 1 - src/Artemis.Core/Plugins/Modules/Module.cs | 17 ++- .../ScriptingProviders/ScriptingProvider.cs | 5 +- .../Events/SingleValueEventArgs.cs | 25 ++-- src/Artemis.Core/VisualScripting/InputPin.cs | 116 +++++++++------ .../VisualScripting/InputPinCollection.cs | 88 ++++++++---- .../VisualScripting/Interfaces/INodeScript.cs | 4 +- .../VisualScripting/Interfaces/IPin.cs | 60 +++++++- .../Interfaces/IPinCollection.cs | 42 +++++- .../Internal/DataBindingExitNode.cs | 4 +- .../VisualScripting/Internal/ExitNode.cs | 2 +- src/Artemis.Core/VisualScripting/Node.cs | 6 +- .../VisualScripting/NodeAttribute.cs | 53 +++++-- src/Artemis.Core/VisualScripting/NodeData.cs | 90 ++++++++---- .../VisualScripting/NodeScript.cs | 17 ++- src/Artemis.Core/VisualScripting/OutputPin.cs | 132 +++++++++++------- .../VisualScripting/OutputPinCollection.cs | 7 + src/Artemis.Core/VisualScripting/Pin.cs | 65 +++++---- .../VisualScripting/PinCollection.cs | 89 ++++++++---- .../VisualScripting/PinDirection.cs | 12 +- .../DataBindings/DataBindingsViewModel.cs | 2 +- src/Artemis.UI/Stylet/NinjectBootstrapper.cs | 3 +- .../Editor/Controls/VisualScriptPresenter.cs | 2 +- .../Styles/VisualScriptNodePresenter.xaml | 39 +++--- .../Nodes/LayerPropertyNode.cs | 2 +- .../Nodes/Maths/ExpressionNode.cs | 3 +- 30 files changed, 644 insertions(+), 265 deletions(-) diff --git a/src/Artemis.Core/Extensions/IEnumerableExtensions.cs b/src/Artemis.Core/Extensions/IEnumerableExtensions.cs index 0c60de0f9..c7ee21841 100644 --- a/src/Artemis.Core/Extensions/IEnumerableExtensions.cs +++ b/src/Artemis.Core/Extensions/IEnumerableExtensions.cs @@ -93,6 +93,13 @@ namespace Artemis.Core } } + /// + /// Returns the index of the provided element inside the read only collection + /// + /// The type of element to find + /// The collection to search in + /// The element to find + /// If found, the index of the element to find; otherwise -1 public static int IndexOf(this IReadOnlyCollection self, T elementToFind) { int i = 0; @@ -102,6 +109,7 @@ namespace Artemis.Core return i; i++; } + return -1; } } diff --git a/src/Artemis.Core/Models/Profile/Conditions/EventCondition.cs b/src/Artemis.Core/Models/Profile/Conditions/EventCondition.cs index 0f787c91b..0ba1f5a86 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/EventCondition.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/EventCondition.cs @@ -6,6 +6,9 @@ using Artemis.Storage.Entities.Profile.Conditions; namespace Artemis.Core { + /// + /// Represents a condition that is based on a + /// public class EventCondition : CorePropertyChanged, INodeScriptCondition { private readonly string _displayName; @@ -78,7 +81,7 @@ namespace Artemis.Core } else { - _eventNode = new EventDefaultNode() {X = -300}; + _eventNode = new EventDefaultNode {X = -300}; _eventNode.UpdateDataModelEvent(dataModelEvent); } diff --git a/src/Artemis.Core/Models/Profile/Conditions/StaticCondition.cs b/src/Artemis.Core/Models/Profile/Conditions/StaticCondition.cs index 4e4b41874..2419d1387 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/StaticCondition.cs +++ b/src/Artemis.Core/Models/Profile/Conditions/StaticCondition.cs @@ -3,11 +3,17 @@ using Artemis.Storage.Entities.Profile.Conditions; namespace Artemis.Core { + /// + /// Represents a condition that is based on a data model value + /// public class StaticCondition : CorePropertyChanged, INodeScriptCondition { - private readonly StaticConditionEntity _entity; private readonly string _displayName; + private readonly StaticConditionEntity _entity; + /// + /// Creates a new instance of the class + /// public StaticCondition(ProfileElement profileElement) { _entity = new StaticConditionEntity(); diff --git a/src/Artemis.Core/Models/Profile/DataModel/IDataModelEvent.cs b/src/Artemis.Core/Models/Profile/DataModel/IDataModelEvent.cs index 4357dc3c6..4ab9d271c 100644 --- a/src/Artemis.Core/Models/Profile/DataModel/IDataModelEvent.cs +++ b/src/Artemis.Core/Models/Profile/DataModel/IDataModelEvent.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; namespace Artemis.Core { /// - /// Represents a data model event that can trigger s. + /// Represents an event that is part of a data model /// public interface IDataModelEvent { diff --git a/src/Artemis.Core/Models/Profile/Timeline.cs b/src/Artemis.Core/Models/Profile/Timeline.cs index 139b5a8c0..86c9023d7 100644 --- a/src/Artemis.Core/Models/Profile/Timeline.cs +++ b/src/Artemis.Core/Models/Profile/Timeline.cs @@ -82,7 +82,6 @@ namespace Artemis.Core private TimeSpan _position; private TimeSpan _lastDelta; - private TimeLineEventOverlapMode _eventOverlapMode; private TimelinePlayMode _playMode; private TimelineStopMode _stopMode; private readonly List _extraTimelines; diff --git a/src/Artemis.Core/Plugins/Modules/Module.cs b/src/Artemis.Core/Plugins/Modules/Module.cs index 8f2c56a60..43e5a07f5 100644 --- a/src/Artemis.Core/Plugins/Modules/Module.cs +++ b/src/Artemis.Core/Plugins/Modules/Module.cs @@ -114,17 +114,20 @@ namespace Artemis.Core.Modules private readonly List<(DefaultCategoryName, string)> _defaultProfilePaths = new(); private readonly List<(DefaultCategoryName, string)> _pendingDefaultProfilePaths = new(); - protected Module() - { - DefaultProfilePaths = new ReadOnlyCollection<(DefaultCategoryName, string)>(_defaultProfilePaths); - HiddenProperties = new(HiddenPropertiesList); - } - /// /// Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y) /// protected internal readonly List HiddenPropertiesList = new(); + /// + /// The base constructor of the class. + /// + protected Module() + { + DefaultProfilePaths = new ReadOnlyCollection<(DefaultCategoryName, string)>(_defaultProfilePaths); + HiddenProperties = new ReadOnlyCollection(HiddenPropertiesList); + } + /// /// Gets a read only collection of default profile paths /// @@ -237,7 +240,7 @@ namespace Artemis.Core.Modules /// public virtual DataModelPropertyAttribute GetDataModelDescription() { - return new() {Name = Plugin.Info.Name, Description = Plugin.Info.Description}; + return new DataModelPropertyAttribute {Name = Plugin.Info.Name, Description = Plugin.Info.Description}; } /// diff --git a/src/Artemis.Core/Plugins/ScriptingProviders/ScriptingProvider.cs b/src/Artemis.Core/Plugins/ScriptingProviders/ScriptingProvider.cs index 0ae720943..1f8d4b1c4 100644 --- a/src/Artemis.Core/Plugins/ScriptingProviders/ScriptingProvider.cs +++ b/src/Artemis.Core/Plugins/ScriptingProviders/ScriptingProvider.cs @@ -44,9 +44,12 @@ namespace Artemis.Core.ScriptingProviders /// public abstract class ScriptingProvider : PluginFeature { + /// + /// The base constructor of the class + /// protected ScriptingProvider() { - Scripts = new(InternalScripts); + Scripts = new ReadOnlyCollection