mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Added first visual-scripting draft [WIP]
This commit is contained in:
1 parent
719d95bd33
commit
a45dd094a0
56 files changed
+5139
-21
No files matched your search
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Artemis.Core.VisualScripting
|
||||
{
|
||||
public interface INode : INotifyPropertyChanged
|
||||
{
|
||||
string Name { get; }
|
||||
string Description { get; }
|
||||
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
|
||||
public IReadOnlyCollection<IPin> Pins { get; }
|
||||
public IReadOnlyCollection<IPinCollection> PinCollections { get; }
|
||||
|
||||
public object CustomView { get; }
|
||||
public object CustomViewModel { get; }
|
||||
|
||||
event EventHandler Resetting;
|
||||
|
||||
void Evaluate();
|
||||
void Reset();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Artemis.VisualScripting.Model;
|
||||
|
||||
namespace Artemis.Core.VisualScripting
|
||||
{
|
||||
public interface IPin
|
||||
{
|
||||
INode Node { get; }
|
||||
|
||||
string Name { get; }
|
||||
PinDirection Direction { get; }
|
||||
Type Type { get; }
|
||||
object PinValue { get; }
|
||||
|
||||
bool IsEvaluated { get; set; }
|
||||
|
||||
void ConnectTo(IPin pin);
|
||||
void DisconnectFrom(IPin pin);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Artemis.VisualScripting.Model;
|
||||
|
||||
namespace Artemis.Core.VisualScripting
|
||||
{
|
||||
public interface IPinCollection : IEnumerable<IPin>
|
||||
{
|
||||
string Name { get; }
|
||||
PinDirection Direction { get; }
|
||||
Type Type { get; }
|
||||
|
||||
IPin AddPin();
|
||||
bool Remove(IPin pin);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Artemis.Core.VisualScripting
|
||||
{
|
||||
public interface IScript : INotifyPropertyChanged, IDisposable
|
||||
{
|
||||
string Name { get; }
|
||||
string Description { get; }
|
||||
|
||||
IEnumerable<INode> Nodes { get; }
|
||||
|
||||
Type ResultType { get; }
|
||||
|
||||
void Run();
|
||||
void AddNode(INode node);
|
||||
void RemoveNode(INode node);
|
||||
}
|
||||
|
||||
public interface IScript<out T> : IScript
|
||||
{
|
||||
T Result { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Artemis.VisualScripting.Model
|
||||
{
|
||||
public enum PinDirection
|
||||
{
|
||||
Input,
|
||||
Output
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user