Merge branch 'development' into VisualScripting

This commit is contained in:
Robert committed 2021-09-12 13:00:58 +02:00
commit 2a6c004aa6
28 files changed
+252 -126

No files matched your search

+1 -1
View File
@@ -306,7 +306,7 @@ namespace Artemis.Core
ChildrenList.Add(new Layer(Profile, this, childLayer));
// Ensure order integrity, should be unnecessary but no one is perfect specially me
ChildrenList = ChildrenList.OrderBy(c => c.Order).ToList();
ChildrenList.Sort((a,b) => a.Order.CompareTo(b.Order));
for (int index = 0; index < ChildrenList.Count; index++)
ChildrenList[index].Order = index + 1;
+4 -1
View File
@@ -43,6 +43,7 @@ namespace Artemis.Core
_transform = new LayerTransformProperties();
_leds = new List<ArtemisLed>();
Leds = new ReadOnlyCollection<ArtemisLed>(_leds);
Adapter = new LayerAdapter(this);
Initialize();
@@ -67,6 +68,7 @@ namespace Artemis.Core
_transform = new LayerTransformProperties();
_leds = new List<ArtemisLed>();
Leds = new ReadOnlyCollection<ArtemisLed>(_leds);
Adapter = new LayerAdapter(this);
Load();
@@ -76,7 +78,7 @@ namespace Artemis.Core
/// <summary>
/// A collection of all the LEDs this layer is assigned to.
/// </summary>
public ReadOnlyCollection<ArtemisLed> Leds => _leds.AsReadOnly();
public ReadOnlyCollection<ArtemisLed> Leds { get; private set; }
/// <summary>
/// Defines the shape that is rendered by the <see cref="LayerBrush" />.
@@ -679,6 +681,7 @@ namespace Artemis.Core
}
_leds = leds;
Leds = new ReadOnlyCollection<ArtemisLed>(_leds);
CalculateRenderProperties();
}
@@ -45,6 +45,7 @@ namespace Artemis.Core
_baseValue = default!;
_keyframes = new List<LayerPropertyKeyframe<T>>();
Keyframes = new(_keyframes);
}
/// <summary>
@@ -229,7 +230,7 @@ namespace Artemis.Core
#region Keyframes
private bool _keyframesEnabled;
private List<LayerPropertyKeyframe<T>> _keyframes;
private readonly List<LayerPropertyKeyframe<T>> _keyframes;
/// <summary>
/// Gets whether keyframes are supported on this type of property
@@ -255,7 +256,7 @@ namespace Artemis.Core
/// <summary>
/// Gets a read-only list of all the keyframes on this layer property
/// </summary>
public ReadOnlyCollection<LayerPropertyKeyframe<T>> Keyframes => _keyframes.AsReadOnly();
public ReadOnlyCollection<LayerPropertyKeyframe<T>> Keyframes { get; }
/// <summary>
/// Gets the current keyframe in the timeline according to the current progress
@@ -328,7 +329,7 @@ namespace Artemis.Core
/// </summary>
internal void SortKeyframes()
{
_keyframes = _keyframes.OrderBy(k => k.Position).ToList();
_keyframes.Sort((a, b) => a.Position.CompareTo(b.Position));
}
private void UpdateKeyframes(Timeline timeline)
@@ -37,6 +37,9 @@ namespace Artemis.Core
_layerProperties = new List<ILayerProperty>();
_layerPropertyGroups = new List<LayerPropertyGroup>();
LayerProperties = new(_layerProperties);
LayerPropertyGroups = new(_layerPropertyGroups);
}
/// <summary>
@@ -96,12 +99,12 @@ namespace Artemis.Core
/// <summary>
/// A list of all layer properties in this group
/// </summary>
public ReadOnlyCollection<ILayerProperty> LayerProperties => _layerProperties.AsReadOnly();
public ReadOnlyCollection<ILayerProperty> LayerProperties { get; }
/// <summary>
/// A list of al child groups in this group
/// </summary>
public ReadOnlyCollection<LayerPropertyGroup> LayerPropertyGroups => _layerPropertyGroups.AsReadOnly();
public ReadOnlyCollection<LayerPropertyGroup> LayerPropertyGroups { get; }
/// <summary>
/// Recursively gets all layer properties on this group and any subgroups
@@ -24,12 +24,15 @@ namespace Artemis.Core
{
_name = name;
Entity = new ProfileCategoryEntity();
ProfileConfigurations = new(_profileConfigurations);
}
internal ProfileCategory(ProfileCategoryEntity entity)
{
_name = null!;
Entity = entity;
ProfileConfigurations = new(_profileConfigurations);
Load();
}
@@ -73,7 +76,7 @@ namespace Artemis.Core
/// <summary>
/// Gets a read only collection of the profiles inside this category
/// </summary>
public ReadOnlyCollection<ProfileConfiguration> ProfileConfigurations => _profileConfigurations.AsReadOnly();
public ReadOnlyCollection<ProfileConfiguration> ProfileConfigurations { get; }
/// <summary>
/// Gets the unique ID of this category
@@ -18,12 +18,13 @@ namespace Artemis.Core
private Profile _profile;
private bool _suspended;
internal List<ProfileElement> ChildrenList;
internal readonly List<ProfileElement> ChildrenList;
internal ProfileElement(Profile profile)
{
_profile = profile;
ChildrenList = new List<ProfileElement>();
Children = new(ChildrenList);
}
/// <summary>
@@ -56,16 +57,7 @@ namespace Artemis.Core
/// <summary>
/// The element's children
/// </summary>
public ReadOnlyCollection<ProfileElement> Children
{
get
{
lock (ChildrenList)
{
return ChildrenList.AsReadOnly();
}
}
}
public ReadOnlyCollection<ProfileElement> Children { get; }
/// <summary>
/// The order in which this element appears in the update loop and editor
@@ -28,7 +28,8 @@ namespace Artemis.Core
Timeline = new Timeline();
ExpandedPropertyGroups = new List<string>();
LayerEffectsList = new List<BaseLayerEffect>();
LayerEffects = new(LayerEffectsList);
LayerEffectStore.LayerEffectAdded += LayerEffectStoreOnLayerEffectAdded;
LayerEffectStore.LayerEffectRemoved += LayerEffectStoreOnLayerEffectRemoved;
}
@@ -235,12 +236,12 @@ namespace Artemis.Core
#region Effect management
internal List<BaseLayerEffect> LayerEffectsList;
internal readonly List<BaseLayerEffect> LayerEffectsList;
/// <summary>
/// Gets a read-only collection of the layer effects on this entity
/// </summary>
public ReadOnlyCollection<BaseLayerEffect> LayerEffects => LayerEffectsList.AsReadOnly();
public ReadOnlyCollection<BaseLayerEffect> LayerEffects { get; }
/// <summary>
/// Adds a the layer effect described inthe provided <paramref name="descriptor" />
+4 -1
View File
@@ -24,6 +24,7 @@ namespace Artemis.Core
MainSegmentLength = TimeSpan.FromSeconds(5);
_extraTimelines = new List<Timeline>();
ExtraTimelines = new(_extraTimelines);
Save();
}
@@ -32,6 +33,7 @@ namespace Artemis.Core
{
Entity = entity;
_extraTimelines = new List<Timeline>();
ExtraTimelines = new(_extraTimelines);
Load();
}
@@ -45,6 +47,7 @@ namespace Artemis.Core
EndSegmentLength = Parent.EndSegmentLength;
_extraTimelines = new List<Timeline>();
ExtraTimelines = new(_extraTimelines);
}
/// <inheritdoc />
@@ -150,7 +153,7 @@ namespace Artemis.Core
/// <summary>
/// Gets a list of extra copies of the timeline applied to this timeline
/// </summary>
public ReadOnlyCollection<Timeline> ExtraTimelines => _extraTimelines.AsReadOnly();
public ReadOnlyCollection<Timeline> ExtraTimelines { get; }
/// <summary>
/// Gets a boolean indicating whether the timeline has finished its run