mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Nodes - Reorganized code
This commit is contained in:
1 parent
69b881b044
commit
7c83d5345f
73 files changed
+1055
-738
No files matched your search
@@ -23,7 +23,7 @@ namespace Artemis.Core
|
||||
return false;
|
||||
if (ReferenceEquals(this, obj))
|
||||
return true;
|
||||
if (obj.GetType() != this.GetType())
|
||||
if (obj.GetType() != GetType())
|
||||
return false;
|
||||
return Equals((ColorGradientStop) obj);
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ namespace Artemis.Core
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
if (obj.GetType() != GetType()) return false;
|
||||
return Equals((DataModelPath) obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Artemis.Core
|
||||
/// <param name="texture">The texture drawn by this brush.</param>
|
||||
public SKTextureBrush(SKTexture? texture)
|
||||
{
|
||||
this.Texture = texture;
|
||||
Texture = texture;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Artemis.Core
|
||||
public bool IsTop(T value)
|
||||
{
|
||||
bool result = false;
|
||||
if (this.Count > 0)
|
||||
if (Count > 0)
|
||||
{
|
||||
result = Peek()!.Equals(value);
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace Artemis.Core
|
||||
public bool Contains(T value)
|
||||
{
|
||||
bool result = false;
|
||||
if (this.Count > 0)
|
||||
if (Count > 0)
|
||||
{
|
||||
result = _list.Contains(value);
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
public ExitNode(string name, string description = "")
|
||||
{
|
||||
this.Name = name;
|
||||
this.Description = description;
|
||||
Name = name;
|
||||
Description = description;
|
||||
|
||||
Input = CreateInputPin<T>();
|
||||
}
|
||||
|
||||
@@ -167,6 +167,21 @@ public abstract class Node : CorePropertyChanged, INode
|
||||
return isRemoved;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds an existing <paramref name="pin"/> to the <see cref="Pins" /> collection.
|
||||
/// </summary>
|
||||
/// <param name="pin">The pin to add</param>
|
||||
protected void AddPin(Pin pin)
|
||||
{
|
||||
if (pin.Node != this)
|
||||
throw new ArtemisCoreException("Can't add a pin to a node that belongs to a different node than the one it's being added to.");
|
||||
if (_pins.Contains(pin))
|
||||
return;
|
||||
|
||||
_pins.Add(pin);
|
||||
OnPropertyChanged(nameof(Pins));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new input pin collection and adds it to the <see cref="PinCollections" /> collection
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user