source generator
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="src\Enigmos\Modules\SubModules\" />
|
||||
<Folder Include="src\GlobalManagement\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
6
src/Attributes/DirectAsset.cs
Normal file
6
src/Attributes/DirectAsset.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Nocturnis.Attributes;
|
||||
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class)]
|
||||
public class DirectAsset : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
6
src/Attributes/UniqueInheritance.cs
Normal file
6
src/Attributes/UniqueInheritance.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Nocturnis.Attributes;
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class UniqueInheritance : Attribute
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using Nocturnis.UIElements;
|
||||
|
||||
namespace Nocturnis.Creatures.Characters;
|
||||
|
||||
public interface IBaseCharacter : IBaseCreature
|
||||
{
|
||||
IDashboardTab DashboardTab { get; set; }
|
||||
}
|
||||
9
src/Creatures/Characters/INonPlayerCharacter.cs
Normal file
9
src/Creatures/Characters/INonPlayerCharacter.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Nocturnis.Enigmos.Boards;
|
||||
using Nocturnis.UIElements;
|
||||
|
||||
namespace Nocturnis.Creatures.Characters;
|
||||
|
||||
public interface INonPlayerCharacter : IBaseCreature
|
||||
{
|
||||
|
||||
}
|
||||
10
src/Creatures/Characters/IPlayerCharacter.cs
Normal file
10
src/Creatures/Characters/IPlayerCharacter.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Nocturnis.Enigmos.Boards;
|
||||
using Nocturnis.UIElements;
|
||||
|
||||
namespace Nocturnis.Creatures.Characters;
|
||||
|
||||
public interface IPlayerCharacter : IBaseCharacter
|
||||
{
|
||||
IDashboardTab DashboardTab { get; set; }
|
||||
IPrimaryBoard MotherBoard { get; set; }
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using Nocturnis.Inventories.Items;
|
||||
using Skeleton.Algebra;
|
||||
using Skeleton.Algebra.DimensionProviders;
|
||||
|
||||
@@ -7,4 +8,5 @@ public interface ICreatureAction
|
||||
{
|
||||
void Move(R2 dir);
|
||||
void Attack(R2 dir);
|
||||
void Drop(IBaseItem item);
|
||||
}
|
||||
6
src/Creatures/IBaseCharacter.cs
Normal file
6
src/Creatures/IBaseCharacter.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Nocturnis.Creatures;
|
||||
|
||||
public interface IBaseCharacter : IBaseCreature
|
||||
{
|
||||
|
||||
}
|
||||
11
src/ENodeInterface.cs
Normal file
11
src/ENodeInterface.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Godot;
|
||||
|
||||
namespace Nocturnis;
|
||||
|
||||
public static class ENodeInterface
|
||||
{
|
||||
public static Node AsNode(this INodeInterface n)
|
||||
{
|
||||
return n as Node;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
using Nocturnis.Enigmos.Cables;
|
||||
using Nocturnis.Enigmos.Ports;
|
||||
using Nocturnis.UIElements;
|
||||
using Nocturnis.UIElements.Layers;
|
||||
|
||||
namespace Nocturnis.Enigmos.Boards;
|
||||
|
||||
public interface IBaseBoard
|
||||
{
|
||||
IPanelViewer? PanelViewer { get; set; }
|
||||
IEnumerable<IBasePort> OnBoardPorts { get; }
|
||||
IBasePort? ConnectPending { get; set; }
|
||||
Dictionary<IBasePort, IBaseCable> CablePairing { get; set; }
|
||||
void AddCable(IBaseCable cable);
|
||||
@@ -15,4 +18,6 @@ public interface IBaseBoard
|
||||
IModuleManualLayer? ModuleManualLayer { get; set; }
|
||||
IModuleMovingLayer? ModuleMovingLayer { get; set; }
|
||||
void Reset();
|
||||
void SetCableVisualMode(bool mode);
|
||||
void SetLabelVisualMode(bool mode);
|
||||
}
|
||||
8
src/Enigmos/Boards/IPrimaryBoard.cs
Normal file
8
src/Enigmos/Boards/IPrimaryBoard.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
|
||||
namespace Nocturnis.Enigmos.Boards;
|
||||
|
||||
public interface IPrimaryBoard : IBaseBoard
|
||||
{
|
||||
IEngineModule Engine { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Nocturnis.Enigmos.ModuleManuals;
|
||||
|
||||
public interface IModuleManualTab
|
||||
public interface IModuleManualTab : INodeInterface
|
||||
{
|
||||
string FullName();
|
||||
}
|
||||
@@ -7,6 +7,7 @@ namespace Nocturnis.Enigmos.Modules;
|
||||
|
||||
public interface IBaseModule
|
||||
{
|
||||
Texture2D? PreviewTexture { get; }
|
||||
IEnumerable<IBasePort> Ports { get; }
|
||||
IBaseBoard? Board { get; set; }
|
||||
Vector2 PositionToBoard { get; }
|
||||
@@ -14,7 +15,7 @@ public interface IBaseModule
|
||||
double MaintenanceAlpha { get; }
|
||||
double MaintenanceBeta { get; }
|
||||
string GetDescription { get; }
|
||||
ISimpleLabel? Label { get; }
|
||||
Label? Label { get; }
|
||||
Node AsNode { get; }
|
||||
Vector2 Position { get; set; }
|
||||
string LabelString { get; set; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Nocturnis.Enigmos.Modules;
|
||||
|
||||
public interface ICompositeModule
|
||||
public interface ICompositeModule : IBaseModule
|
||||
{
|
||||
IBaseModule[] SubModules { get; }
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
using Godot;
|
||||
|
||||
namespace Nocturnis.Enigmos.Modules;
|
||||
|
||||
public interface IComputationalCompositeModule : ICompositeModule
|
||||
{
|
||||
Vector2 PositionToBoard { get; }
|
||||
}
|
||||
6
src/Enigmos/Modules/IEngineModule.cs
Normal file
6
src/Enigmos/Modules/IEngineModule.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Nocturnis.Enigmos.Modules;
|
||||
|
||||
public interface IEngineModule : ITerminalModule
|
||||
{
|
||||
|
||||
}
|
||||
9
src/Enigmos/Modules/IEnumerableProcessingModule.cs
Normal file
9
src/Enigmos/Modules/IEnumerableProcessingModule.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Nocturnis.DataStructures;
|
||||
|
||||
namespace Nocturnis.Enigmos.Modules;
|
||||
|
||||
public interface IEnumerableProcessingModule : ICompositeModule
|
||||
{
|
||||
IData[] CachedInputArray { get; set; }
|
||||
int ProcessingIndex { get; set; }
|
||||
}
|
||||
11
src/Enigmos/Modules/IInternalComputationalModule.cs
Normal file
11
src/Enigmos/Modules/IInternalComputationalModule.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Nocturnis.DataStructures;
|
||||
|
||||
namespace Nocturnis.Enigmos.Modules;
|
||||
|
||||
public interface IInternalComputationalModule : ICompositeModule
|
||||
{
|
||||
IData? CachedResult { get; set; }
|
||||
void Compute();
|
||||
bool ComputationFinished { get; set; }
|
||||
bool ComputationStarted { get; set; }
|
||||
}
|
||||
@@ -5,7 +5,7 @@ namespace Nocturnis.Enigmos.Modules;
|
||||
public interface IOptimizationModule : IProgrammableModule
|
||||
{
|
||||
IData CachedResult { get; set; }
|
||||
bool OptimizationStarted { get; set; }
|
||||
bool OptimizationFinished { get; set; }
|
||||
bool ComputationStarted { get; set; }
|
||||
bool ComputationFinished { get; set; }
|
||||
void Optimize();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace Nocturnis.Enigmos.Modules;
|
||||
|
||||
public interface IProgrammableModule : IBaseModule
|
||||
public interface IProgrammableModule : ICompositeModule
|
||||
{
|
||||
}
|
||||
@@ -3,5 +3,6 @@ namespace Nocturnis.Enigmos.Modules;
|
||||
public interface ITerminalModule : IParameterModule
|
||||
{
|
||||
void Drain();
|
||||
bool Finished { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Nocturnis.DataStructures;
|
||||
using Skeleton.DataStructure;
|
||||
|
||||
namespace Nocturnis.Enigmos.Ports.DataPorts.Directions;
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using Nocturnis.DataStructures;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using Nocturnis.Enigmos.Modules.ComputationalModules;
|
||||
using Skeleton.DataStructure;
|
||||
|
||||
namespace Nocturnis.Enigmos.Ports.DataPorts.Directions;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Nocturnis.Enigmos.Ports;
|
||||
|
||||
public interface IBasePort
|
||||
{
|
||||
Vector2 PositionToBoard { get; }
|
||||
bool Connected { get; }
|
||||
IBaseModule? Module { get; set; }
|
||||
bool IsMatch(IBasePort oth);
|
||||
|
||||
@@ -19,5 +19,5 @@ public class CreatureControl
|
||||
{
|
||||
}
|
||||
|
||||
public IBaseCharacter? CurrentCharacter { get; set; }
|
||||
public IPlayerCharacter? CurrentCharacter { get; set; }
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Nocturnis.GlobalManagement.Controls;
|
||||
|
||||
@@ -23,11 +24,14 @@ public class EnigmosControl
|
||||
|
||||
public void ShutDownEngine()
|
||||
{
|
||||
EngineUp = false;
|
||||
}
|
||||
|
||||
public void PowerUpEngine()
|
||||
{
|
||||
EngineUp = true;
|
||||
}
|
||||
|
||||
public double Energy { get; set; } = 0d;
|
||||
public bool EngineUp { get; private set; }
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Godot;
|
||||
|
||||
namespace Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
public static class GlobalProvider
|
||||
@@ -8,4 +10,19 @@ public static class GlobalProvider
|
||||
public static ISceneProvider? SceneProvider { get; set; }
|
||||
public static IPolymorphismProvider? PolymorphismProvider { get; set; }
|
||||
public static IDataPackageTypeProvider? DataPackageTypeProvider { get; set; }
|
||||
public static ITextureProvider? TextureProvider { get; set; }
|
||||
|
||||
public static readonly Dictionary<StringName, PackedScene> AssetNameMapper = new();
|
||||
|
||||
public static class ItemIconMapper<W>
|
||||
{
|
||||
public static Texture2D? Texture { get; set; }
|
||||
}
|
||||
|
||||
public static class AssetMapper<T>
|
||||
{
|
||||
public static PackedScene Scene { get; set; }
|
||||
}
|
||||
|
||||
public static Font Font { get; set; }
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using Godot;
|
||||
using Nocturnis.Scenes;
|
||||
|
||||
namespace Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
public interface ISceneProvider
|
||||
{
|
||||
IRootScene RootScene { get; set; }
|
||||
PackedScene AssetMapper<T>();
|
||||
}
|
||||
IRootScene? RootScene { get; set; }
|
||||
}
|
||||
|
||||
11
src/GlobalManagement/Providers/ITextureProvider.cs
Normal file
11
src/GlobalManagement/Providers/ITextureProvider.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Godot;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using Nocturnis.Inventories.Items;
|
||||
|
||||
namespace Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
public interface ITextureProvider
|
||||
{
|
||||
Texture2D ModuleTextureMapper(IBaseModule module);
|
||||
Texture2D ItemTextureMapper(IBaseItem item);
|
||||
}
|
||||
8
src/IDirectAsset.cs
Normal file
8
src/IDirectAsset.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Nocturnis.Attributes;
|
||||
|
||||
namespace Nocturnis;
|
||||
[DirectAsset]
|
||||
public interface IDirectAsset
|
||||
{
|
||||
|
||||
}
|
||||
8
src/INodeInterface.cs
Normal file
8
src/INodeInterface.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Godot;
|
||||
|
||||
namespace Nocturnis;
|
||||
|
||||
public interface INodeInterface
|
||||
{
|
||||
|
||||
}
|
||||
6
src/ISceneConcept.cs
Normal file
6
src/ISceneConcept.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Nocturnis;
|
||||
|
||||
public interface ISceneConcept
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
namespace Nocturnis.Inventories.Items;
|
||||
using Godot;
|
||||
using Skeleton.Algebra;
|
||||
using Skeleton.Algebra.DimensionProviders;
|
||||
|
||||
public interface IBaseItem
|
||||
namespace Nocturnis.Inventories.Items;
|
||||
using R2 = CategoryOf<IDim2>.OnField<double>.FVector;
|
||||
public interface IBaseItem : INodeInterface
|
||||
{
|
||||
|
||||
StringName Status { get; set; }
|
||||
R2 ItemPosition { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
using Godot;
|
||||
|
||||
namespace Nocturnis.UIElements;
|
||||
|
||||
public interface IPanelViewer
|
||||
{
|
||||
Camera2D? PanelViewerCamera { get; set; }
|
||||
void BackToCenter();
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ using Godot;
|
||||
|
||||
namespace Nocturnis.UIElements;
|
||||
|
||||
public interface ISimpleLabel
|
||||
public interface ISimpleLabel : ISceneConcept
|
||||
{
|
||||
Vector2 Position { get; set; }
|
||||
Vector2 Size { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user