Upgrade structure of code base
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using Enigmos.Modules.Extensions;
|
||||
using Godot;
|
||||
using Nocturnis.Communicators;
|
||||
using Nocturnis.Enigmos.ModuleManuals;
|
||||
|
||||
@@ -2,7 +2,7 @@ using Enigmos.Modules.ProgrammableModules;
|
||||
using Godot;
|
||||
using Nocturnis.Enigmos.ModuleManuals;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using TabulaSmaragdina;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using Godot;
|
||||
using Nocturnis.DataStructures.ConfigurableParameters;
|
||||
using Nocturnis.Enigmos.ModuleManuals;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using TabulaSmaragdina;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Godot;
|
||||
using Nocturnis.DataStructures;
|
||||
using Nocturnis.DataStructures.DataPortGroups;
|
||||
using Nocturnis.Enigmos.ModuleManuals;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using TabulaSmaragdina;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using Enigmos.Modules.ProgrammableModules;
|
||||
using Enigmos.Ports;
|
||||
using Godot;
|
||||
using Nocturnis.Enigmos.ModuleManuals;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using Nocturnis.Enigmos.Ports;
|
||||
using TabulaSmaragdina;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
@@ -19,18 +18,18 @@ public partial class PortMaintenanceTab : Panel, IModuleManualTab
|
||||
}
|
||||
|
||||
public string FullName() => "Maintenance";
|
||||
private static readonly PackedScene PortFixerScene = GlobalProvider.SceneProvider.AssetMapper<PortFixer>();
|
||||
private static readonly PackedScene PortFixerScene = GlobalProvider.SceneProvider!.AssetMapper<PortFixer>();
|
||||
/// <summary>
|
||||
/// Should Be Assigned Before This Tab Been Added As Child To Tab Container
|
||||
/// </summary>
|
||||
public IBaseModule Module { get; set; }
|
||||
private VBoxContainer Ports { get; set; }
|
||||
public IBaseModule? Module { get; set; }
|
||||
private VBoxContainer? Ports { get; set; }
|
||||
public override void _Ready()
|
||||
{
|
||||
if (!InitFlag)
|
||||
throw new Exception("TODO - NEED INIT");
|
||||
Ports = GetNode<VBoxContainer>("ScrolledItems/Ports");
|
||||
foreach (IBasePort port in Module.Ports)
|
||||
foreach (IBasePort port in Module!.Ports)
|
||||
{
|
||||
PortFixer fixer = PortFixerScene.Instantiate<PortFixer>();
|
||||
fixer.Init(port);
|
||||
@@ -40,7 +39,7 @@ public partial class PortMaintenanceTab : Panel, IModuleManualTab
|
||||
if (Module is ProgrammableModule programmableModule)
|
||||
{
|
||||
HashSet<string> used = new HashSet<string>();
|
||||
foreach (BasePort port in programmableModule.ExplicitPorts())
|
||||
foreach (IBasePort port in programmableModule.ExplicitPorts)
|
||||
{
|
||||
int i = 0;
|
||||
while (used.Contains("Exterior" + port.Name + $"#{i}"))
|
||||
@@ -51,7 +50,7 @@ public partial class PortMaintenanceTab : Panel, IModuleManualTab
|
||||
fixer.Init(port);
|
||||
Ports.AddChild(fixer);
|
||||
}
|
||||
foreach (BasePort port in programmableModule.ImplicitPorts())
|
||||
foreach (IBasePort port in programmableModule.ImplicitPorts)
|
||||
{
|
||||
string baseName = port.Name.ToString().Replace("Empty", "Interior");
|
||||
int i = 0;
|
||||
@@ -68,5 +67,4 @@ public partial class PortMaintenanceTab : Panel, IModuleManualTab
|
||||
Name = "Main";
|
||||
base._Ready();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Godot;
|
||||
using Nocturnis.DataStructures;
|
||||
using TabulaSmaragdina;
|
||||
using Nocturnis.DataStructures.DataPortGroups;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
@@ -17,9 +17,9 @@ public partial class PortTypeSelector : Control
|
||||
/// <summary>
|
||||
/// Underlying Group must be set before _Ready
|
||||
/// </summary>
|
||||
public IDataPortGroup UnderlyingGroup { get; set; }
|
||||
private Label Description { get; set; }
|
||||
private OptionButton TypeOptions { get; set; }
|
||||
public IDataPortGroup? UnderlyingGroup { get; set; }
|
||||
private Label? Description { get; set; }
|
||||
private OptionButton? TypeOptions { get; set; }
|
||||
public override void _Ready()
|
||||
{
|
||||
if (!InitFlag)
|
||||
@@ -27,15 +27,15 @@ public partial class PortTypeSelector : Control
|
||||
Description = GetNode<Label>("Description");
|
||||
TypeOptions = GetNode<OptionButton>("TypeOptions");
|
||||
TypeOptions.Clear();
|
||||
for (int idx = 0; idx < UnderlyingGroup.TypeOptions.Length; idx++)
|
||||
TypeOptions.AddIconItem(GlobalProvider.EnigmosProvider.DataPortTypeMap[UnderlyingGroup.TypeOptions[idx]], "", idx);
|
||||
for (int idx = 0; idx < UnderlyingGroup!.TypeOptions.Length; idx++)
|
||||
TypeOptions.AddIconItem(GlobalProvider.EnigmosProvider!.DataPortTypeMap[UnderlyingGroup.TypeOptions[idx]], "", idx);
|
||||
Description.Text = UnderlyingGroup.Description;
|
||||
TypeOptions.Select(Array.IndexOf(UnderlyingGroup.TypeOptions, UnderlyingGroup.SelectedType));
|
||||
}
|
||||
|
||||
private void SetType(int index)
|
||||
{
|
||||
UnderlyingGroup.SelectedType = UnderlyingGroup.TypeOptions[index];
|
||||
UnderlyingGroup!.SelectedType = UnderlyingGroup.TypeOptions[index];
|
||||
UnderlyingGroup.Inference();
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
using Enigmos.Modules.ProgrammableModules;
|
||||
using Godot;
|
||||
using Nocturnis.Enigmos.ModuleManuals;
|
||||
using TabulaSmaragdina;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Enigmos.Manual;
|
||||
|
||||
public partial class ProgrammableModuleSettingTab : Panel, IModuleManualTab
|
||||
{
|
||||
private ProgrammableModule Module { get; set; }
|
||||
private ProgrammableModule? Module { get; set; }
|
||||
|
||||
private Button EditModule { get; set; }
|
||||
private Button? EditModule { get; set; }
|
||||
|
||||
public void Init(ProgrammableModule module)
|
||||
{
|
||||
@@ -27,6 +27,6 @@ public partial class ProgrammableModuleSettingTab : Panel, IModuleManualTab
|
||||
|
||||
private void EnterProgrammableBoard()
|
||||
{
|
||||
GlobalProvider.SceneProvider.RootScene.ChangeScene(Module.UnderlyingBoard);
|
||||
GlobalProvider.SceneProvider!.RootScene.ChangeScene(Module!.UnderlyingBoard);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user