This commit is contained in:
h z
2024-07-12 14:32:16 +01:00
parent 5548a7243b
commit 1df3c08a9e
20 changed files with 119 additions and 148 deletions

View File

@@ -9,7 +9,11 @@ using Nocturnis.GlobalManagement.Providers;
namespace Enigmos.Modules.TerminalModules;
public abstract partial class MemoryModule : BaseModule, ITerminalModule, ISourceModule, IDuplicateOutputModule
public abstract partial class MemoryModule : BaseModule,
ITerminalModule,
ISourceModule,
IDuplicateOutputModule,
IPolymorphismModule
{
private DataVariable? Memory { get; set; }
private IDataPortGroup? MemoryPortGroup { get; set; }

View File

@@ -6,11 +6,11 @@ namespace Enigmos.Modules.TerminalModules.TestingModules;
public partial class R2Reader : Control
{
private AnimatedSprite2D? Direction { get; set; }
private AnimatedSprite2D? Magnitude { get; set; }
public R2? UnderlyingVector { get; set; }
private double TargetPhase() => Math.Atan2(UnderlyingVector![2], UnderlyingVector![1]);
private double TargetLength() => UnderlyingVector!.Magnitude;
private AnimatedSprite2D Direction { get; set; }
private AnimatedSprite2D Magnitude { get; set; }
public R2 UnderlyingVector { get; set; }
private double TargetPhase() => UnderlyingVector == null ? 0: Math.Atan2(UnderlyingVector![2], UnderlyingVector![1]);
private double TargetLength() => UnderlyingVector?.Magnitude ?? 0;
private int TargetPhaseFrame =>
Mathf.FloorToInt((TargetPhase() % (2d * Math.PI) + 2d * Math.PI) % (2d * Math.PI) * 44d / (2d * Math.PI));