Upgrade structure of code base
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user