Data Type
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Godot;
|
||||
using Nocturnis.Enigmos.Modules;
|
||||
using Nocturnis.Enigmos.Modules.ComputationalModules;
|
||||
using Nocturnis.Enigmos.Ports;
|
||||
using Nocturnis.Enigmos.Ports.DataPorts.Directions;
|
||||
using Nocturnis.GlobalManagement.Constants;
|
||||
using Skeleton.Utils.Helpers;
|
||||
@@ -17,7 +16,7 @@ public abstract partial class RealReaderModule : BaseModule, ITerminalModule, IO
|
||||
{
|
||||
base.Init();
|
||||
this.DataInInit("Input", 3);
|
||||
this.SetInputType(EnigmosConstant.DataPortTypes.Real);
|
||||
this.SetInputType(DataTypeConstant.BaseDataTypes.Real);
|
||||
RealReader = GetNode<AnimatedSprite2D>("RealReader");
|
||||
RealReader.SpeedScale = 0;
|
||||
RealReader.Play();
|
||||
@@ -26,9 +25,9 @@ public abstract partial class RealReaderModule : BaseModule, ITerminalModule, IO
|
||||
|
||||
public void Drain()
|
||||
{
|
||||
double max = DataInPorts[0].GetData.Get!.Double;
|
||||
double min = DataInPorts[2].GetData.Get!.Double;
|
||||
double value = DataInPorts[1].GetData.Get!.Double;
|
||||
double max = DataInPorts[0].GetData.Get!.Real;
|
||||
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();
|
||||
int frame = Mathf.FloorToInt(percentage * 122);
|
||||
|
||||
Reference in New Issue
Block a user