bracket system
This commit is contained in:
@@ -53,7 +53,7 @@ public abstract partial class V2Module : BinaryComputationalModule,
|
||||
|
||||
if (x.Type == DataTypeConstant.BaseDataTypes.Complex || y.Type == DataTypeConstant.BaseDataTypes.Complex)
|
||||
return (new C2(x.Complex, y.Complex), DataTypeConstant.BaseDataTypes.C2);
|
||||
return (new R2(x.Real, y.Real), DataTypeConstant.BaseDataTypes.Real);
|
||||
return (new R2(x.Real, y.Real), DataTypeConstant.BaseDataTypes.R2);
|
||||
}
|
||||
this.Define(Func);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public abstract partial class MoveActionModule : ActionModule, ITerminalModule
|
||||
|
||||
public override void Act()
|
||||
{
|
||||
CreatureControl.Instance.CurrentCharacter!.Action.Attack(DataInPorts[0].GetData.Get!.R2);
|
||||
if (!DataInPorts[0].Connected)
|
||||
return;
|
||||
CreatureControl.Instance.CurrentCharacter!.Action.Move(DataInPorts[0].GetData.Get!.R2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract partial class EngineModule : TerminalModule, IEngineModule
|
||||
public override void Drain()
|
||||
{
|
||||
base.Drain();
|
||||
if (FuelTank!.Item!.ContentMaterial.Layers.Count == 0)
|
||||
if (FuelTank.Item == null || FuelTank.Item.ContentMaterial.Layers.Count == 0)
|
||||
{
|
||||
EnigmosControl.Instance.Energy = 0;
|
||||
return;
|
||||
|
||||
@@ -11,8 +11,8 @@ public abstract partial class SRLatchModule : BaseModule,
|
||||
IDuplicateOutputModule,
|
||||
IOperationModule
|
||||
{
|
||||
public IDataOutPort[] DataOutPorts { get; set; } = Array.Empty<IDataOutPort>();
|
||||
public IDataInPort[] DataInPorts { get; set; } = Array.Empty<IDataInPort>();
|
||||
public IDataOutPort[] DataOutPorts { get; set; }
|
||||
public IDataInPort[] DataInPorts { get; set; }
|
||||
|
||||
private bool State { get; set; }
|
||||
|
||||
|
||||
@@ -3,18 +3,15 @@ using Godot;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using Nocturnis.Enigmos.Ports.DataPorts.Directions;
|
||||
using Nocturnis.GlobalManagement.Constants;
|
||||
using Nocturnis.GlobalManagement.Providers;
|
||||
|
||||
namespace Enigmos.Modules.TerminalModules.TestingModules;
|
||||
|
||||
public abstract partial class LightEmittingDiodeModule : TerminalModule
|
||||
{
|
||||
private Sprite2D? LightEmittingDiode { get; set; }
|
||||
private IDataInPort? Input { get; set; }
|
||||
private Sprite2D LightEmittingDiode { get; set; }
|
||||
private IDataInPort Input { get; set; }
|
||||
|
||||
private static readonly Texture2D TrueTexture =
|
||||
ResourceLoader.Load<Texture2D>("res://Resources/Circuits/Modules/Terminal/Testing/LEDBubble-T.png");
|
||||
private static readonly Texture2D FalseTexture =
|
||||
ResourceLoader.Load<Texture2D>("res://Resources/Circuits/Modules/Terminal/Testing/LEDBubble-F.png");
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
@@ -27,10 +24,10 @@ public abstract partial class LightEmittingDiodeModule : TerminalModule
|
||||
|
||||
public override void Drain()
|
||||
{
|
||||
if (Input!.GetData.Get!.Bit)
|
||||
LightEmittingDiode!.Texture = TrueTexture;
|
||||
if (Input.GetData.Get.Bit)
|
||||
LightEmittingDiode.Texture = GlobalProvider.TextureProvider.LEDOn;
|
||||
else
|
||||
LightEmittingDiode!.Texture = FalseTexture;
|
||||
LightEmittingDiode.Texture = GlobalProvider.TextureProvider.LEDOff;
|
||||
Finished = true;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace Enigmos.Modules.TerminalModules.TestingModules;
|
||||
|
||||
public abstract partial class RealReaderModule : BaseModule, ITerminalModule, IOperationModule
|
||||
{
|
||||
private AnimatedSprite2D? RealReader { get; set; }
|
||||
private AnimatedSprite2D RealReader { get; set; }
|
||||
public IDataInPort[] DataInPorts { get; set; } = Array.Empty<IDataInPort>();
|
||||
|
||||
public override void Init()
|
||||
@@ -29,7 +29,7 @@ public abstract partial class RealReaderModule : BaseModule, ITerminalModule, IO
|
||||
double min = DataInPorts[2].GetData.Get!.Real;
|
||||
double value = DataInPorts[1].GetData.Get!.Real;
|
||||
double range = max - min;
|
||||
double percentage = (range == 0 ? 0d : value / range).DoubleCut();
|
||||
double percentage = (range == 0 ? 0d : (value - min) / range).DoubleCut();
|
||||
int frame = Mathf.FloorToInt(percentage * 122);
|
||||
RealReader!.SpeedScale = (frame - RealReader.Frame) / 60f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user