Split project
This commit is contained in:
34
Modules/ProgrammableModules/ProgrammableModule.cs
Normal file
34
Modules/ProgrammableModules/ProgrammableModule.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Enigmos.Boards;
|
||||
using Enigmos.Ports;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using TabulaSmaragdina;
|
||||
|
||||
namespace Enigmos.Modules.ProgrammableModules;
|
||||
|
||||
public abstract partial class ProgrammableModule : BaseModule, ICompositeModule, IProgrammableModule
|
||||
{
|
||||
public BaseBoard UnderlyingBoard { get; set; }
|
||||
public abstract IBaseModule[] SubModules();
|
||||
public void EnterProgrammableBoard() => GlobalProvider.SceneProvider.RootScene.ChangeScene(UnderlyingBoard);
|
||||
public abstract IEnumerable<BasePort> ExplicitPorts();
|
||||
public abstract IEnumerable<BasePort> ImplicitPorts();
|
||||
public override void UpdateCables()
|
||||
{
|
||||
foreach (BasePort port in ExplicitPorts())
|
||||
{
|
||||
if(!Board.CablePairing.ContainsKey(port) )
|
||||
continue;
|
||||
Board.CablePairing[port].LineUpdate();
|
||||
}
|
||||
base.UpdateCables();
|
||||
}
|
||||
|
||||
protected T GetModule<T>(string path) where T : BaseModule, IInterlayerModule
|
||||
{
|
||||
T res = GetNode<T>(path);
|
||||
res.Init();
|
||||
res.ParentModule = this;
|
||||
res.Board = Board;
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user