Data Type

This commit is contained in:
h z
2024-07-11 11:21:29 +01:00
parent a8688d7f95
commit bd5ab1e940
62 changed files with 233 additions and 277 deletions

View File

@@ -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);