Upgrade
This commit is contained in:
4
ConfigurableParameterSetters
Normal file
4
ConfigurableParameterSetters
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
ModuleRealValueParameterSetter,DoubleParameter
|
||||||
|
ModuleBoolValueParameterSetter,BoolParameter
|
||||||
|
ModuleCharValueParameterSetter,CharParameter
|
||||||
|
ModuleKeyValueParameterSetter,KeyParameter
|
||||||
6
ModuleTabs
Normal file
6
ModuleTabs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
PortMaintenanceTab,BaseModule
|
||||||
|
ModuleParameterTab,ParameterizedModule
|
||||||
|
ModulePolymorphismTab,PolymorphismModule
|
||||||
|
CommunicatorPairTab,CommunicateModule
|
||||||
|
ProgrammableModuleSettingTab,ProgrammableModule
|
||||||
|
ErrorHandlerTab,ErrorHandlerModule
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="GodotSharp" Version="4.3.0-beta.2" />
|
<PackageReference Include="GodotSharp" Version="4.3.0-beta.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
6
src/Attributes/Expose.cs
Normal file
6
src/Attributes/Expose.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Nocturnis.Attributes;
|
||||||
|
[AttributeUsage(AttributeTargets.Method)]
|
||||||
|
public class Expose : Attribute
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
6
src/Attributes/Installer.cs
Normal file
6
src/Attributes/Installer.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Nocturnis.Attributes;
|
||||||
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
|
public class Installer :Attribute
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,5 +4,5 @@ public interface IDoubleParameter : IConfigurableParameter<double>
|
|||||||
{
|
{
|
||||||
double MinValue { get; set; }
|
double MinValue { get; set; }
|
||||||
double MaxValue { get; set; }
|
double MaxValue { get; set; }
|
||||||
double Step { get; set; }
|
double Step { get; }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Nocturnis.DataStructures.ConfigurableParameters;
|
||||||
|
|
||||||
|
public interface IModuleParameterSetter : INodeInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
|
using Nocturnis.Enigmos.Ports.DataPorts.Directions;
|
||||||
|
|
||||||
namespace Nocturnis.DataStructures.DataPortGroups;
|
namespace Nocturnis.DataStructures.DataPortGroups;
|
||||||
|
|
||||||
public interface IDataInGroup : IDataPortGroup, IEnumerable<IDataInGroup>
|
public interface IDataInGroup : IDataPortGroup, IEnumerable<IDataInPort>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
|
using Nocturnis.DataStructures.DataTypeOptions;
|
||||||
using Nocturnis.DataStructures.DataTypes;
|
using Nocturnis.DataStructures.DataTypes;
|
||||||
|
|
||||||
namespace Nocturnis.DataStructures.DataPortGroups;
|
namespace Nocturnis.DataStructures.DataPortGroups;
|
||||||
@@ -6,7 +7,7 @@ namespace Nocturnis.DataStructures.DataPortGroups;
|
|||||||
public interface IDataPortGroup
|
public interface IDataPortGroup
|
||||||
{
|
{
|
||||||
DataType SelectedType { get; set; }
|
DataType SelectedType { get; set; }
|
||||||
DataType[] TypeOptions { get; set; }
|
DataTypeOption TypeOptions { get; set; }
|
||||||
|
|
||||||
void Inference();
|
void Inference();
|
||||||
string Description { get; set; }
|
string Description { get; set; }
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using Nocturnis.GlobalManagement.Providers;
|
|||||||
|
|
||||||
namespace Nocturnis.DataStructures.DataTypeOptions;
|
namespace Nocturnis.DataStructures.DataTypeOptions;
|
||||||
|
|
||||||
public class DataTypeOption : HashSet<DataType>
|
public class DataTypeOption : List<DataType>
|
||||||
{
|
{
|
||||||
public DataTypeOption(params DataType[] options) : base(options)
|
public DataTypeOption(params DataType[] options) : base(options)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,11 +99,12 @@ public class DataType
|
|||||||
public static bool operator !=(DataType a, DataType b) => a?.Signature != b?.Signature;
|
public static bool operator !=(DataType a, DataType b) => a?.Signature != b?.Signature;
|
||||||
|
|
||||||
public void Assign(DataType oth)
|
public void Assign(DataType oth)
|
||||||
{
|
{
|
||||||
Type = oth.Type;
|
Type = oth.Type;
|
||||||
if (ElementType == null)
|
if (ElementType == null)
|
||||||
ElementType = new();
|
ElementType = new();
|
||||||
ElementType.Assign(oth.ElementType);
|
if(Type == DataTypeConstant.NestedDataTypeNames.Array)
|
||||||
|
ElementType.Assign(oth.ElementType);
|
||||||
StructName = oth.StructName;
|
StructName = oth.StructName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
|
|
||||||
namespace Nocturnis.DataStructures;
|
|
||||||
|
|
||||||
public interface IVariantWithType
|
|
||||||
{
|
|
||||||
Variant UnderlyingData { get; set; }
|
|
||||||
string TypeHint { get; set; }
|
|
||||||
}
|
|
||||||
14
src/DataStructures/VariantWithType.cs
Normal file
14
src/DataStructures/VariantWithType.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using Godot;
|
||||||
|
|
||||||
|
namespace Alchegos.DataStructure;
|
||||||
|
|
||||||
|
public partial class VariantWithType : Resource
|
||||||
|
{
|
||||||
|
public VariantWithType(StringName typeHint, Variant underlyingData)
|
||||||
|
{
|
||||||
|
TypeHint = typeHint;
|
||||||
|
UnderlyingData = underlyingData;
|
||||||
|
}
|
||||||
|
public StringName TypeHint { get; set; }
|
||||||
|
public Variant UnderlyingData { get; set; }
|
||||||
|
}
|
||||||
@@ -1,23 +1,25 @@
|
|||||||
using Nocturnis.Enigmos.Cables;
|
using Nocturnis.Enigmos.Cables;
|
||||||
|
using Nocturnis.Enigmos.Modules;
|
||||||
using Nocturnis.Enigmos.Ports;
|
using Nocturnis.Enigmos.Ports;
|
||||||
using Nocturnis.UIElements;
|
using Nocturnis.UIElements;
|
||||||
using Nocturnis.UIElements.Layers;
|
using Nocturnis.UIElements.Layers;
|
||||||
|
|
||||||
namespace Nocturnis.Enigmos.Boards;
|
namespace Nocturnis.Enigmos.Boards;
|
||||||
|
|
||||||
public interface IBaseBoard
|
public interface IBaseBoard : INodeInterface
|
||||||
{
|
{
|
||||||
IPanelViewer? PanelViewer { get; set; }
|
IPanelViewer PanelViewer { get; set; }
|
||||||
IEnumerable<IBasePort> OnBoardPorts { get; }
|
IEnumerable<IBasePort> OnBoardPorts { get; }
|
||||||
IBasePort? ConnectPending { get; set; }
|
IBasePort ConnectPending { get; set; }
|
||||||
Dictionary<IBasePort, IBaseCable> CablePairing { get; set; }
|
Dictionary<IBasePort, IBaseCable> CablePairing { get; set; }
|
||||||
void AddCable(IBaseCable cable);
|
void AddCable(IBaseCable cable);
|
||||||
HashSet<IBaseCable> FocusedCables { get; set; }
|
HashSet<IBaseCable> FocusedCables { get; set; }
|
||||||
bool ManualOpened { get; set; }
|
bool ManualOpened { get; set; }
|
||||||
bool CableVisualMode { get; set; }
|
bool CableVisualMode { get; set; }
|
||||||
IModuleManualLayer? ModuleManualLayer { get; set; }
|
IModuleManualLayer ModuleManualLayer { get; set; }
|
||||||
IModuleMovingLayer? ModuleMovingLayer { get; set; }
|
IModuleMovingLayer ModuleMovingLayer { get; set; }
|
||||||
void Reset();
|
void Reset();
|
||||||
void SetCableVisualMode(bool mode);
|
void SetCableVisualMode(bool mode);
|
||||||
void SetLabelVisualMode(bool mode);
|
void SetLabelVisualMode(bool mode);
|
||||||
|
public IEnumerable<ITerminalModule> TerminalModules { get; }
|
||||||
}
|
}
|
||||||
11
src/Enigmos/ModuleManuals/IModuleManual.cs
Normal file
11
src/Enigmos/ModuleManuals/IModuleManual.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
using Godot;
|
||||||
|
using Nocturnis.Enigmos.Modules;
|
||||||
|
|
||||||
|
namespace Nocturnis.Enigmos.ModuleManuals;
|
||||||
|
|
||||||
|
public interface IModuleManual : INodeInterface
|
||||||
|
{
|
||||||
|
Vector2 Size { get; set; }
|
||||||
|
Vector2 Position { get; set; }
|
||||||
|
void Init(IBaseModule m);
|
||||||
|
}
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
using Godot;
|
using Godot;
|
||||||
using Nocturnis.Enigmos.Boards;
|
using Nocturnis.Enigmos.Boards;
|
||||||
|
using Nocturnis.Enigmos.ModuleManuals;
|
||||||
using Nocturnis.Enigmos.Ports;
|
using Nocturnis.Enigmos.Ports;
|
||||||
using Nocturnis.UIElements;
|
|
||||||
|
|
||||||
namespace Nocturnis.Enigmos.Modules;
|
namespace Nocturnis.Enigmos.Modules;
|
||||||
|
|
||||||
public interface IBaseModule
|
public interface IBaseModule
|
||||||
{
|
{
|
||||||
Texture2D? PreviewTexture { get; }
|
Texture2D PreviewTexture { get; }
|
||||||
IEnumerable<IBasePort> Ports { get; }
|
IEnumerable<IBasePort> Ports { get; }
|
||||||
IBaseBoard? Board { get; set; }
|
IBaseBoard Board { get; set; }
|
||||||
Vector2 PositionToBoard { get; }
|
Vector2 PositionToBoard { get; }
|
||||||
Vector2 Size { get; set; }
|
Vector2 Size { get; set; }
|
||||||
double MaintenanceAlpha { get; }
|
double MaintenanceAlpha { get; }
|
||||||
double MaintenanceBeta { get; }
|
double MaintenanceBeta { get; }
|
||||||
string GetDescription { get; }
|
string GetDescription { get; }
|
||||||
Label? Label { get; }
|
Label Label { get; }
|
||||||
Node AsNode { get; }
|
Node AsNode { get; }
|
||||||
Vector2 Position { get; set; }
|
Vector2 Position { get; set; }
|
||||||
string LabelString { get; set; }
|
string LabelString { get; set; }
|
||||||
void UpdateCables();
|
void UpdateCables();
|
||||||
Node GetNode(NodePath path);
|
Node GetNode(NodePath path);
|
||||||
void Init();
|
void Init();
|
||||||
|
IModuleManual Manual { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
|
using Nocturnis.DataStructures.ConfigurableParameters;
|
||||||
|
|
||||||
namespace Nocturnis.Enigmos.Modules;
|
namespace Nocturnis.Enigmos.Modules;
|
||||||
|
|
||||||
public interface IKeyListenerModule
|
public interface IKeyListenerModule
|
||||||
{
|
{
|
||||||
|
bool Pressed { get; set; }
|
||||||
|
IKeyParameter ListeningKey { get; set; }
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
|
using Nocturnis.Enigmos.Boards;
|
||||||
|
|
||||||
namespace Nocturnis.Enigmos.Modules;
|
namespace Nocturnis.Enigmos.Modules;
|
||||||
|
|
||||||
public interface IProgrammableModule : ICompositeModule
|
public interface IProgrammableModule : ICompositeModule
|
||||||
{
|
{
|
||||||
|
IBaseBoard UnderlyingBoard { get; set; }
|
||||||
}
|
}
|
||||||
@@ -5,9 +5,8 @@ namespace Nocturnis.Enigmos.Modules;
|
|||||||
|
|
||||||
public interface IRootModule : IRoutingModule
|
public interface IRootModule : IRoutingModule
|
||||||
{
|
{
|
||||||
Stopwatch? Timer { get; set; }
|
|
||||||
bool ActionFinished { get; set; }
|
bool ActionFinished { get; set; }
|
||||||
IBaseCreature? ManagedBy { get; set; }
|
IBaseCreature ManagedBy { get; set; }
|
||||||
void Start();
|
void Start();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ public static class EBasePort
|
|||||||
p.Condition = Mathf.FloorToInt(Math.Max(0, Math.Min(100, p.Condition + dCond)));
|
p.Condition = Mathf.FloorToInt(Math.Max(0, Math.Min(100, p.Condition + dCond)));
|
||||||
p.Quality = Mathf.FloorToInt(Math.Max(0, Math.Min(20000, p.Quality + dQuality)));
|
p.Quality = Mathf.FloorToInt(Math.Max(0, Math.Min(20000, p.Quality + dQuality)));
|
||||||
}
|
}
|
||||||
public static void Connect(this IBasePort p)
|
public static void ExtConnect(this IBasePort p)
|
||||||
{
|
{
|
||||||
if(p.Connected)
|
if(p.Connected)
|
||||||
p.Disconnect();
|
p.Disconnect();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public static class GlobalProvider
|
|||||||
public static ISceneProvider SceneProvider { get; set; }
|
public static ISceneProvider SceneProvider { get; set; }
|
||||||
public static IPolymorphismProvider PolymorphismProvider { get; set; }
|
public static IPolymorphismProvider PolymorphismProvider { get; set; }
|
||||||
public static IDataTypeProvider DataTypeProvider { get; set; }
|
public static IDataTypeProvider DataTypeProvider { get; set; }
|
||||||
|
public static IProcessProvider ProcessProvider { get; set; }
|
||||||
|
|
||||||
public static class ModulePreviewMapper<TModule>
|
public static class ModulePreviewMapper<TModule>
|
||||||
where TModule : IBaseModule
|
where TModule : IBaseModule
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ public interface IDataStructureProvider
|
|||||||
Variant NewVariantWithType(string type, Variant a);
|
Variant NewVariantWithType(string type, Variant a);
|
||||||
IBoolParameter NewBoolParameter(string d, string t, string f, bool def);
|
IBoolParameter NewBoolParameter(string d, string t, string f, bool def);
|
||||||
|
|
||||||
IDataPortGroup NewDataPortGroup(IBaseModule m, IDataPort[] pts, string desc, DataType defType, DataTypeOption typeOpts);
|
IDataPortGroup NewDataPortGroup(IPolymorphismModule m, IDataPort[] pts, string desc, DataType defType, DataTypeOption typeOpts);
|
||||||
|
|
||||||
IDataInGroup NewDataInGroup(IBaseModule m, IDataInPort[] pts, string desc, DataType defType, DataTypeOption typeOpts);
|
IDataInGroup NewDataInGroup(IPolymorphismModule m, IDataInPort[] pts, string desc, DataType defType, DataTypeOption typeOpts);
|
||||||
|
|
||||||
IDataOutGroup NewDataOutGroup(IBaseModule m, IDataOutPort[] pts, string desc, DataType defType, DataTypeOption typeOpts);
|
IDataOutGroup NewDataOutGroup(IPolymorphismModule m, IDataOutPort[] pts, string desc, DataType defType, DataTypeOption typeOpts);
|
||||||
|
|
||||||
IDoubleParameter NewDoubleParameter(string name, double min, double max, double def);
|
IDoubleParameter NewDoubleParameter(string name, double min, double max, double def);
|
||||||
IKeyParameter NewKeyParameter(string a, string b);
|
IKeyParameter NewKeyParameter(string a, string b);
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ public interface IDataTypeProvider
|
|||||||
{
|
{
|
||||||
bool IsComplexTensorType(DataType type);
|
bool IsComplexTensorType(DataType type);
|
||||||
DataType ComplexVersionOf(DataType type);
|
DataType ComplexVersionOf(DataType type);
|
||||||
DataType BuildType(DataType nType, int i, int j);
|
|
||||||
DataType GetBaseField(DataType type);
|
DataType GetBaseField(DataType type);
|
||||||
bool DataPortTypeCompatible(DataType inType, DataType outType);
|
bool DataPortTypeCompatible(DataType inType, DataType outType);
|
||||||
DataType ToElement(DataType arrayType);
|
DataType ToElement(DataType arrayType);
|
||||||
|
DataType ToVector(DataType scalarType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,18 +5,16 @@ namespace Nocturnis.GlobalManagement.Providers;
|
|||||||
|
|
||||||
public interface IEnigmosProvider
|
public interface IEnigmosProvider
|
||||||
{
|
{
|
||||||
Texture2D DataPortStatusNormal { get; set; }
|
AnimatedTexture DataPortStatusNormal { get; set; }
|
||||||
Texture2D DataPortStatusPending { get; set; }
|
AnimatedTexture DataPortStatusPending { get; set; }
|
||||||
Texture2D DataPortStatusConnected { get; set; }
|
AnimatedTexture DataPortStatusConnected { get; set; }
|
||||||
|
|
||||||
Texture2D SignalPortStatusNormal { get; set; }
|
AnimatedTexture SignalPortStatusNormal { get; set; }
|
||||||
Texture2D SignalPortStatusPending { get; set; }
|
AnimatedTexture SignalPortStatusPending { get; set; }
|
||||||
Texture2D SignalPortStatusConnected { get; set; }
|
AnimatedTexture SignalPortStatusConnected { get; set; }
|
||||||
|
|
||||||
PackedScene SignalCableScene { get; set; }
|
PackedScene SignalCableScene { get; set; }
|
||||||
PackedScene DataCableScene { get; set; }
|
PackedScene DataCableScene { get; set; }
|
||||||
Dictionary<DataType, Texture2D> DataPortTypeMap { get; set; }
|
|
||||||
|
|
||||||
bool CommunicationDirectionCompatible(StringName moduleDir, StringName communicatorDir);
|
bool CommunicationDirectionCompatible(StringName moduleDir, StringName communicatorDir);
|
||||||
|
|
||||||
string ModuleDescription<T>();
|
string ModuleDescription<T>();
|
||||||
|
|||||||
20
src/GlobalManagement/Providers/IProcessProvider.cs
Normal file
20
src/GlobalManagement/Providers/IProcessProvider.cs
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
using Nocturnis.DataStructures.ConfigurableParameters;
|
||||||
|
using Nocturnis.Enigmos.ModuleManuals;
|
||||||
|
using Nocturnis.Enigmos.Modules;
|
||||||
|
|
||||||
|
namespace Nocturnis.GlobalManagement.Providers;
|
||||||
|
|
||||||
|
public interface IProcessProvider
|
||||||
|
{
|
||||||
|
void BuildManual(IBaseModule module);
|
||||||
|
IModuleManualTab BuildPortMaintenanceTab(IBaseModule module);
|
||||||
|
IModuleManualTab BuildModulePolymorphismTab(IPolymorphismModule module);
|
||||||
|
IModuleManualTab BuildModuleParameterTab(IParameterizedModule module);
|
||||||
|
IModuleManualTab BuildCommunicatorPairTab(ICommunicateModule module);
|
||||||
|
IModuleManualTab BuildProgrammableModuleSettingTab(IProgrammableModule module);
|
||||||
|
IModuleManualTab BuildErrorHandlerTab(IErrorHandlerModule module);
|
||||||
|
IModuleParameterSetter BuildModuleRealValueParameterSetter(IDoubleParameter para);
|
||||||
|
IModuleParameterSetter BuildModuleBoolValueParameterSetter(IBoolParameter para);
|
||||||
|
IModuleParameterSetter BuildModuleCharValueParameterSetter(ICharParameter para);
|
||||||
|
IModuleParameterSetter BuildModuleKeyValueParameterSetter(IKeyParameter para);
|
||||||
|
}
|
||||||
@@ -8,4 +8,8 @@ public interface IBaseItem : INodeInterface
|
|||||||
{
|
{
|
||||||
StringName Status { get; set; }
|
StringName Status { get; set; }
|
||||||
R2 ItemPosition { get; set; }
|
R2 ItemPosition { get; set; }
|
||||||
|
Texture2D ItemIcon { get; }
|
||||||
|
void Free();
|
||||||
|
StringName ItemClass { get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ namespace Nocturnis.UIElements;
|
|||||||
public interface IKeyListener
|
public interface IKeyListener
|
||||||
{
|
{
|
||||||
void Register(IKeyListenerModule module);
|
void Register(IKeyListenerModule module);
|
||||||
|
void Init();
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ namespace Nocturnis.UIElements;
|
|||||||
|
|
||||||
public interface IPanelViewer
|
public interface IPanelViewer
|
||||||
{
|
{
|
||||||
Camera2D? PanelViewerCamera { get; set; }
|
IPanelViewerCamera PanelViewerCamera { get; }
|
||||||
void BackToCenter();
|
void BackToCenter();
|
||||||
|
|
||||||
}
|
}
|
||||||
8
src/UIElements/IPanelViewerCamera.cs
Normal file
8
src/UIElements/IPanelViewerCamera.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
using Godot;
|
||||||
|
|
||||||
|
namespace Nocturnis.UIElements;
|
||||||
|
|
||||||
|
public interface IPanelViewerCamera
|
||||||
|
{
|
||||||
|
Vector2 Zoom { get; set; }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user