IMotionAdapter.cs
Runtime/Adapters/IMotionAdapter.cs
1 using System;
2
3 namespace MeatMotion
4 {
5 public interface IMotionOptions { }
6
7 [Serializable]
8 public readonly struct NoOptions : IMotionOptions, IEquatable<NoOptions>
9 {
10 public bool Equals(NoOptions other) => true;
11 public override bool Equals(object obj) => obj is NoOptions;
12 public override int GetHashCode() => 0;
13 }
14
15 public struct MotionEvaluationContext
16 {
17 public float Progress;
18 public double Time;
19 }
20
21 public interface IMotionAdapter<TValue, TOptions>
22 where TValue : unmanaged
23 where TOptions : unmanaged, IMotionOptions
24 {
25 TValue Evaluate(ref TValue startValue, ref TValue endValue, ref TOptions options, in MotionEvaluationContext context);
26 }
27 }