Split project

This commit is contained in:
h z
2024-06-29 06:35:23 +08:00
commit 6e01c31061
54 changed files with 496 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
bin/
obj/
/packages/
riderModule.iml
/_ReSharper.Caches/

1
Class1.cs Normal file
View File

@@ -0,0 +1 @@

17
Nocturnis.csproj Normal file
View File

@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="GodotSharp" Version="4.3.0-beta.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VirtualChemistry\VirtualChemistry.csproj" />
</ItemGroup>
</Project>

16
Nocturnis.sln Normal file
View File

@@ -0,0 +1,16 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nocturnis", "Nocturnis.csproj", "{E9C078AE-B3C7-40E2-A823-7E42CE89A819}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E9C078AE-B3C7-40E2-A823-7E42CE89A819}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9C078AE-B3C7-40E2-A823-7E42CE89A819}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9C078AE-B3C7-40E2-A823-7E42CE89A819}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9C078AE-B3C7-40E2-A823-7E42CE89A819}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

7
global.json Normal file
View File

@@ -0,0 +1,7 @@
{
"sdk": {
"version": "6.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}
}

View File

@@ -0,0 +1,16 @@
using Godot;
using Nocturnis.DataStructures;
using Nocturnis.Enigmos.Modules;
namespace Nocturnis.Communicators;
public interface IBaseCommunicator
{
ICommunicateModule PairedModule { get; set; }
IDataPackage DataBuffer { get; set; }
StringName CommunicationDataType { get; }
StringName CommunicationDirection { get; }
Texture2D IconTexture { get; }
string CustomName { get; set; }
bool Paired { get; }
}

View File

@@ -0,0 +1,8 @@
using Nocturnis.UIElements;
namespace Nocturnis.Creatures.Characters;
public interface IBaseCharacter : IBaseCreature
{
IDashboardTab DashboardTab { get; set; }
}

View File

@@ -0,0 +1,10 @@
using Skeleton.Algebra;
using Skeleton.Algebra.DimensionProviders;
namespace Nocturnis.Creatures.CreatureActions;
using R2 = CategoryOf<IDim2>.OnField<double>.FVector;
public interface ICreatureAction
{
void Move(R2 dir);
void Attack(R2 dir);
}

View File

@@ -0,0 +1,8 @@
using Nocturnis.Creatures.CreatureActions;
namespace Nocturnis.Creatures;
public interface IBaseCreature
{
ICreatureAction Action { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Nocturnis.DataStructures.ConfigurableParameters;
public interface IBoolParameter : IConfigurableParameter<bool>
{
string TrueDescription { get; set; }
string FalseDescription { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.DataStructures.ConfigurableParameters;
public interface ICharParameter : IConfigurableParameter<char>
{
}

View File

@@ -0,0 +1,11 @@
namespace Nocturnis.DataStructures.ConfigurableParameters;
public interface IConfigurableParameter
{
string ParameterName { get; set; }
}
public interface IConfigurableParameter<T> : IConfigurableParameter
{
T ParameterValue { get; set; }
}

View File

@@ -0,0 +1,8 @@
namespace Nocturnis.DataStructures.ConfigurableParameters;
public interface IDoubleParameter : IConfigurableParameter<double>
{
double MinValue { get; set; }
double MaxValue { get; set; }
double Step { get; set; }
}

View File

@@ -0,0 +1,8 @@
using Godot;
namespace Nocturnis.DataStructures.ConfigurableParameters;
public interface IKeyParameter : IConfigurableParameter<StringName>
{
}

View File

@@ -0,0 +1,12 @@
using Godot;
using Skeleton.Algebra;
using Skeleton.Algebra.DimensionProviders;
namespace Nocturnis.DataStructures;
using R2 = CategoryOf<IDim2>.OnField<double>.FVector;
public interface IDataPackage
{
void Assign(IDataPackage val, StringName key);
bool Bit { get; }
R2 R2 { get; }
}

View File

@@ -0,0 +1,11 @@
using Godot;
namespace Nocturnis.DataStructures;
public interface IDataPortGroup
{
StringName SelectedType { get; set; }
StringName[] TypeOptions { get; set; }
void Inference();
string Description { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.DataStructures;
public interface IPresetModuleConnection
{
}

View File

@@ -0,0 +1,9 @@
using Godot;
namespace Nocturnis.DataStructures;
public interface IVariantWithType
{
Variant UnderlyingData { get; set; }
string TypeHint { get; set; }
}

View File

@@ -0,0 +1,18 @@
using Nocturnis.Enigmos.Cables;
using Nocturnis.Enigmos.Modules;
using Nocturnis.Enigmos.Ports;
using Nocturnis.UIElements.Layers;
namespace Nocturnis.Enigmos.Boards;
public interface IBaseBoard
{
IBasePort? ConnectPending { get; set; }
Dictionary<IBasePort, IBaseCable> CablePairing { get; set; }
void AddCable(IBaseCable cable);
HashSet<IBaseCable> FocusedCables { get; set; }
bool ManualOpened { get; set; }
bool CableVisualMode { get; set; }
IModuleManualLayer ModuleManualLayer { get; set; }
IModuleMovingLayer ModuleMovingLayer { get; set; }
}

View File

@@ -0,0 +1,11 @@
using Godot;
namespace Nocturnis.Enigmos.Cables;
public interface IBaseCable
{
void Free();
void LineUpdate();
Color Modulate { get; set; }
Node AsNode { get; }
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.ModuleManuals;
public interface IModuleManualTab
{
string FullName();
}

View File

@@ -0,0 +1,22 @@
using Godot;
using Nocturnis.Enigmos.Boards;
using Nocturnis.Enigmos.Ports;
using Nocturnis.UIElements;
namespace Nocturnis.Enigmos.Modules;
public interface IBaseModule
{
IEnumerable<IBasePort> Ports { get; }
IBaseBoard Board { get; set; }
Vector2 PositionToBoard { get; }
Vector2 Size { get; set; }
double MaintenanceAlpha { get; }
double MaintenanceBeta { get; }
string GetDescription { get; }
ISimpleLabel Label { get; }
Node AsNode { get; }
Vector2 Position { get; set; }
string LabelString { get; set; }
}

View File

@@ -0,0 +1,13 @@
using Godot;
using Nocturnis.Communicators;
using Nocturnis.DataStructures;
namespace Nocturnis.Enigmos.Modules;
public interface ICommunicateModule
{
IBaseCommunicator PairedCommunicator { get; set; }
StringName CommunicationDataType { get; }
StringName CommunicationDirection { get; }
IDataPackage DataBuffer { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Modules;
public interface ICompositeModule
{
IBaseModule[] SubModules();
}

View File

@@ -0,0 +1,9 @@
using Godot;
namespace Nocturnis.Enigmos.Modules;
public interface IComputationalCompositeModule : ICompositeModule
{
void Compute(IRootModule root);
Vector2 PositionToBoard();
}

View File

@@ -0,0 +1,8 @@
namespace Nocturnis.Enigmos.Modules;
public interface IErrorHandlerModule
{
void ErrorHandler(Exception error, int idx);
string[] HandlingOptions();
int SelectedOption { get; set; }
}

View File

@@ -0,0 +1,9 @@
using Nocturnis.Enigmos.Ports;
namespace Nocturnis.Enigmos.Modules;
public interface IInterlayerDataInModule : IInterlayerModule
{
IInterlayerDataOutModule DualModule { get; set; }
IDataInPort DataIn { get; set; }
}

View File

@@ -0,0 +1,9 @@
using Nocturnis.Enigmos.Ports;
namespace Nocturnis.Enigmos.Modules;
public interface IInterlayerDataOutModule : IInterlayerModule
{
IInterlayerDataInModule DualModule { get; set; }
IDataOutPort DataOut { get; set; }
}

View File

@@ -0,0 +1,10 @@
using Nocturnis.Enigmos.Ports;
namespace Nocturnis.Enigmos.Modules;
public interface IInterlayerModule
{
IBasePort UnderlyingPort();
IProgrammableModule ParentModule { get; set; }
}

View File

@@ -0,0 +1,9 @@
using Nocturnis.Enigmos.Ports;
namespace Nocturnis.Enigmos.Modules;
public interface IInterlayerSignalInModule : IInterlayerModule
{
IInterlayerSignalOutModule DualModule { get; set; }
ISignalInPort SignalIn { get; set; }
}

View File

@@ -0,0 +1,9 @@
using Nocturnis.Enigmos.Ports;
namespace Nocturnis.Enigmos.Modules;
public interface IInterlayerSignalOutModule : IInterlayerModule
{
IInterlayerSignalInModule DualModule { get; set; }
ISignalOutPort SignalOut { get; set; }
}

View File

@@ -0,0 +1,10 @@
using Nocturnis.DataStructures;
using Nocturnis.DataStructures.ConfigurableParameters;
namespace Nocturnis.Enigmos.Modules;
public interface IParameterizedModule
{
HashSet<IConfigurableParameter> ConfigurableParameters { get; set; }
}

View File

@@ -0,0 +1,12 @@
using Nocturnis.DataStructures;
namespace Nocturnis.Enigmos.Modules;
public interface IPolymorphismModule
{
HashSet<IDataPortGroup> ConfigurablePortGroups { get; set; }
/// <summary>
/// Update type of all ports base on configurable port groups' type
/// </summary>
void Inference();
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Modules;
public interface IProgrammableModule
{
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Modules;
public interface IRootModule
{
}

View File

@@ -0,0 +1,19 @@
using Godot;
using Nocturnis.Enigmos.Modules;
using Nocturnis.Inventories.Items.Items;
namespace Nocturnis.Enigmos.Ports;
public interface IBasePort
{
IBaseModule Module { get; set; }
bool IsMatch(IBasePort oth);
IBasePort? ConnectedPort { get; set; }
void SetStatusConnected();
void SetStatusNormal();
void SetStatusPending();
StringName Name { get; set; }
int Condition { get; set; }
int Quality { get; set; }
void FixWith(IBaseChemicalItem item);
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Ports;
public interface IDataInPort
{
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Ports;
public interface IDataOutPort
{
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Ports;
public interface IDataPort
{
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Ports;
public interface ISignalInPort
{
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Ports;
public interface ISignalOutPort
{
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Enigmos.Ports;
public interface ISignalPort
{
}

View File

@@ -0,0 +1,8 @@
using Nocturnis.Inventories.Items;
namespace Nocturnis.Inventories.ItemSlots;
public interface IBaseItemSlot
{
IBaseItem Item { get; set; }
}

View File

@@ -0,0 +1,8 @@
using Nocturnis.Inventories.Items.Items;
namespace Nocturnis.Inventories.ItemSlots.ItemSlots;
public interface IChemicalItemSlot
{
IBaseChemicalItem Item { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.Inventories.Items;
public interface IBaseItem
{
}

View File

@@ -0,0 +1,9 @@
using VirtualChemistry.Chemistry.Mixtures.Implements;
namespace Nocturnis.Inventories.Items.Items;
public interface IBaseChemicalItem : IBaseItem
{
HeterogeneousMixture ContentMaterial { get; set; }
void ConsumeFromBottom(double amount);
}

View File

@@ -0,0 +1,8 @@
using Nocturnis.Enigmos.Modules;
namespace Nocturnis.Inventories.Items.Items;
public interface IBaseModuleItem
{
IBaseModule ContentModule { get; }
}

8
src/Scenes/IRootScene.cs Normal file
View File

@@ -0,0 +1,8 @@
using Godot;
namespace Nocturnis.Scenes;
public interface IRootScene
{
void ChangeScene(Node scene);
}

View File

@@ -0,0 +1,8 @@
using Nocturnis.Communicators;
namespace Nocturnis.UIElements;
public interface IDashboardTab
{
IEnumerable<IBaseCommunicator> AllCommunicators { get; }
}

View File

@@ -0,0 +1,6 @@
namespace Nocturnis.UIElements;
public interface IPanelViewer
{
}

View File

@@ -0,0 +1,12 @@
using Godot;
namespace Nocturnis.UIElements;
public interface ISimpleLabel
{
Vector2 Position { get; set; }
Vector2 Size { get; set; }
string Text { get; set; }
Node AsNode { get; }
bool Visible { get; set; }
}

View File

@@ -0,0 +1,8 @@
using Nocturnis.Enigmos.Boards;
namespace Nocturnis.UIElements.Layers;
public interface IBoardControlLayer
{
IBaseBoard Board { get; set; }
}

View File

@@ -0,0 +1,9 @@
using Godot;
namespace Nocturnis.UIElements.Layers;
public interface IModuleManualLayer
{
void AddChild(Node child);
Marker2D ManualPosition { get; set; }
}

View File

@@ -0,0 +1,12 @@
using Godot;
using Nocturnis.Enigmos.Boards;
using Nocturnis.Enigmos.Modules;
namespace Nocturnis.UIElements.Layers;
public interface IModuleMovingLayer
{
IBaseModule DraggingModule { get; set; }
Vector2 MouseOffset { get; set; }
IBaseBoard Board { get; set; }
}