Move host transport records to model
This commit is contained in:
@@ -384,7 +384,7 @@ public class AdvTextOpsTests
|
||||
|
||||
new VirtualMachine(script, table, host).Run();
|
||||
|
||||
Assert.Equal(new Age.Engine.Hosting.AdvWaitIndicatorConfig(1, 385, 140, 12, 0, 0, 30, 27, 12, 48),
|
||||
Assert.Equal(new AdvWaitIndicatorConfig(1, 385, 140, 12, 0, 0, 30, 27, 12, 48),
|
||||
Assert.Single(host.WaitIndicators));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Age.Engine.Model;
|
||||
|
||||
namespace Age.Engine.Hosting;
|
||||
public sealed class CaptureHost : IHost
|
||||
{
|
||||
|
||||
@@ -2,21 +2,6 @@ using Age.Engine.Model;
|
||||
|
||||
namespace Age.Engine.Hosting;
|
||||
|
||||
public readonly record struct AdvWaitIndicatorConfig(
|
||||
int LayoutSlot, int X, int Y, int SurfaceSlot,
|
||||
int SourceX, int SourceY, int CellWidth, int CellHeight,
|
||||
int TerminalFrame, long FramePeriodMs)
|
||||
{
|
||||
/// <summary>Select the current atlas frame. TerminalFrame is the exclusive native upper bound,
|
||||
/// so SYSTEM4's value 12 addresses the twelve cells 0 through 11.</summary>
|
||||
public int FrameAt(long elapsedMs)
|
||||
{
|
||||
int frameCount = System.Math.Max(1, TerminalFrame);
|
||||
long period = System.Math.Max(1, FramePeriodMs);
|
||||
return (int)(System.Math.Max(0, elapsedMs) / period % frameCount);
|
||||
}
|
||||
}
|
||||
|
||||
public interface IAdvHost
|
||||
{
|
||||
void ShowText(int offset, string text);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Age.Engine.Model;
|
||||
|
||||
namespace Age.Engine.Hosting;
|
||||
|
||||
public interface IDiagnosticHost
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
namespace Age.Engine.Hosting;
|
||||
|
||||
/// <summary>A synchronous AGE-owned diagnostic prompt after native body/context formatting.</summary>
|
||||
public readonly record struct DiagnosticMessage(string Caption, string Text);
|
||||
|
||||
public interface IHost : IDiagnosticHost, ILifecycleHost, IAudioHost, IMovieHost, IGraphicsHost, IInputHost,
|
||||
IAdvHost
|
||||
{
|
||||
|
||||
16
engine/Age.Engine/Model/AdvPresentationContracts.cs
Normal file
16
engine/Age.Engine/Model/AdvPresentationContracts.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace Age.Engine.Model;
|
||||
|
||||
public readonly record struct AdvWaitIndicatorConfig(
|
||||
int LayoutSlot, int X, int Y, int SurfaceSlot,
|
||||
int SourceX, int SourceY, int CellWidth, int CellHeight,
|
||||
int TerminalFrame, long FramePeriodMs)
|
||||
{
|
||||
/// <summary>Select the current atlas frame. TerminalFrame is the exclusive native upper bound,
|
||||
/// so SYSTEM4's value 12 addresses the twelve cells 0 through 11.</summary>
|
||||
public int FrameAt(long elapsedMs)
|
||||
{
|
||||
int frameCount = System.Math.Max(1, TerminalFrame);
|
||||
long period = System.Math.Max(1, FramePeriodMs);
|
||||
return (int)(System.Math.Max(0, elapsedMs) / period % frameCount);
|
||||
}
|
||||
}
|
||||
4
engine/Age.Engine/Model/DiagnosticContracts.cs
Normal file
4
engine/Age.Engine/Model/DiagnosticContracts.cs
Normal file
@@ -0,0 +1,4 @@
|
||||
namespace Age.Engine.Model;
|
||||
|
||||
/// <summary>A synchronous AGE-owned diagnostic prompt after native body/context formatting.</summary>
|
||||
public readonly record struct DiagnosticMessage(string Caption, string Text);
|
||||
@@ -1,4 +1,3 @@
|
||||
using Age.Engine.Hosting;
|
||||
using Age.Engine.Model;
|
||||
|
||||
namespace Age.Engine.Text;
|
||||
|
||||
Reference in New Issue
Block a user