mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
refactor(Dalamud): switch to file-scoped namespaces
This commit is contained in:
parent
13cf3d93dc
commit
b5f34c3199
325 changed files with 45878 additions and 46218 deletions
|
|
@ -2,47 +2,46 @@ using Dalamud.Game.ClientState.Objects;
|
|||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for the Actor Table.
|
||||
/// </summary>
|
||||
internal class ActorTableAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for the Actor Table.
|
||||
/// </summary>
|
||||
internal class ActorTableAgingStep : IAgingStep
|
||||
private int index = 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test ActorTable";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private int index = 0;
|
||||
var objectTable = Service<ObjectTable>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test ActorTable";
|
||||
ImGui.Text("Checking actor table...");
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (this.index == objectTable.Length - 1)
|
||||
{
|
||||
var objectTable = Service<ObjectTable>.Get();
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
ImGui.Text("Checking actor table...");
|
||||
|
||||
if (this.index == objectTable.Length - 1)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
var actor = objectTable[this.index];
|
||||
this.index++;
|
||||
|
||||
if (actor == null)
|
||||
{
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
Util.ShowObject(actor);
|
||||
var actor = objectTable[this.index];
|
||||
this.index++;
|
||||
|
||||
if (actor == null)
|
||||
{
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
Util.ShowObject(actor);
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,71 +3,70 @@ using Dalamud.Game.Text;
|
|||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for Chat.
|
||||
/// </summary>
|
||||
internal class ChatAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for Chat.
|
||||
/// </summary>
|
||||
internal class ChatAgingStep : IAgingStep
|
||||
private int step = 0;
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Chat";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private int step = 0;
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
var chatGui = Service<ChatGui>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Chat";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
switch (this.step)
|
||||
{
|
||||
var chatGui = Service<ChatGui>.Get();
|
||||
case 0:
|
||||
chatGui.Print("Testing!");
|
||||
this.step++;
|
||||
|
||||
switch (this.step)
|
||||
{
|
||||
case 0:
|
||||
chatGui.Print("Testing!");
|
||||
this.step++;
|
||||
break;
|
||||
|
||||
break;
|
||||
case 1:
|
||||
ImGui.Text("Type \"/e DALAMUD\" in chat...");
|
||||
|
||||
case 1:
|
||||
ImGui.Text("Type \"/e DALAMUD\" in chat...");
|
||||
if (!this.subscribed)
|
||||
{
|
||||
this.subscribed = true;
|
||||
chatGui.ChatMessage += this.ChatOnOnChatMessage;
|
||||
}
|
||||
|
||||
if (!this.subscribed)
|
||||
{
|
||||
this.subscribed = true;
|
||||
chatGui.ChatMessage += this.ChatOnOnChatMessage;
|
||||
}
|
||||
if (this.hasPassed)
|
||||
{
|
||||
chatGui.ChatMessage -= this.ChatOnOnChatMessage;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
if (this.hasPassed)
|
||||
{
|
||||
chatGui.ChatMessage -= this.ChatOnOnChatMessage;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
break;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
var chatGui = Service<ChatGui>.Get();
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
chatGui.ChatMessage -= this.ChatOnOnChatMessage;
|
||||
this.subscribed = false;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
var chatGui = Service<ChatGui>.Get();
|
||||
|
||||
private void ChatOnOnChatMessage(
|
||||
XivChatType type, uint senderid, ref SeString sender, ref SeString message, ref bool ishandled)
|
||||
chatGui.ChatMessage -= this.ChatOnOnChatMessage;
|
||||
this.subscribed = false;
|
||||
}
|
||||
|
||||
private void ChatOnOnChatMessage(
|
||||
XivChatType type, uint senderid, ref SeString sender, ref SeString message, ref bool ishandled)
|
||||
{
|
||||
if (type == XivChatType.Echo && message.TextValue == "DALAMUD")
|
||||
{
|
||||
if (type == XivChatType.Echo && message.TextValue == "DALAMUD")
|
||||
{
|
||||
this.hasPassed = true;
|
||||
}
|
||||
this.hasPassed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,36 +2,35 @@ using Dalamud.Game.ClientState.Conditions;
|
|||
using ImGuiNET;
|
||||
using Serilog;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for Condition.
|
||||
/// </summary>
|
||||
internal class ConditionAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for Condition.
|
||||
/// </summary>
|
||||
internal class ConditionAgingStep : IAgingStep
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Condition";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Condition";
|
||||
var condition = Service<Condition>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (!condition.Any())
|
||||
{
|
||||
var condition = Service<Condition>.Get();
|
||||
|
||||
if (!condition.Any())
|
||||
{
|
||||
Log.Error("No condition flags present.");
|
||||
return SelfTestStepResult.Fail;
|
||||
}
|
||||
|
||||
ImGui.Text("Please jump...");
|
||||
|
||||
return condition[ConditionFlag.Jumping] ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
Log.Error("No condition flags present.");
|
||||
return SelfTestStepResult.Fail;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
ImGui.Text("Please jump...");
|
||||
|
||||
return condition[ConditionFlag.Jumping] ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,70 +1,69 @@
|
|||
using Dalamud.Game.ClientState;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for Territory Change.
|
||||
/// </summary>
|
||||
internal class EnterTerritoryAgingStep : IAgingStep
|
||||
{
|
||||
private readonly ushort territory;
|
||||
private readonly string terriName;
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for Territory Change.
|
||||
/// Initializes a new instance of the <see cref="EnterTerritoryAgingStep"/> class.
|
||||
/// </summary>
|
||||
internal class EnterTerritoryAgingStep : IAgingStep
|
||||
/// <param name="terri">The territory to check for.</param>
|
||||
/// <param name="name">Name to show.</param>
|
||||
public EnterTerritoryAgingStep(ushort terri, string name)
|
||||
{
|
||||
private readonly ushort territory;
|
||||
private readonly string terriName;
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
this.terriName = name;
|
||||
this.territory = terri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="EnterTerritoryAgingStep"/> class.
|
||||
/// </summary>
|
||||
/// <param name="terri">The territory to check for.</param>
|
||||
/// <param name="name">Name to show.</param>
|
||||
public EnterTerritoryAgingStep(ushort terri, string name)
|
||||
/// <inheritdoc/>
|
||||
public string Name => $"Enter Terri: {this.terriName}";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
ImGui.TextUnformatted(this.Name);
|
||||
|
||||
if (!this.subscribed)
|
||||
{
|
||||
this.terriName = name;
|
||||
this.territory = terri;
|
||||
clientState.TerritoryChanged += this.ClientStateOnTerritoryChanged;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => $"Enter Terri: {this.terriName}";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (this.hasPassed)
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
ImGui.TextUnformatted(this.Name);
|
||||
|
||||
if (!this.subscribed)
|
||||
{
|
||||
clientState.TerritoryChanged += this.ClientStateOnTerritoryChanged;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
if (this.hasPassed)
|
||||
{
|
||||
clientState.TerritoryChanged -= this.ClientStateOnTerritoryChanged;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
clientState.TerritoryChanged -= this.ClientStateOnTerritoryChanged;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
private void ClientStateOnTerritoryChanged(object sender, ushort e)
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
clientState.TerritoryChanged -= this.ClientStateOnTerritoryChanged;
|
||||
this.subscribed = false;
|
||||
}
|
||||
|
||||
private void ClientStateOnTerritoryChanged(object sender, ushort e)
|
||||
{
|
||||
if (e == this.territory)
|
||||
{
|
||||
if (e == this.territory)
|
||||
{
|
||||
this.hasPassed = true;
|
||||
}
|
||||
this.hasPassed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,47 +2,46 @@ using Dalamud.Game.ClientState.Fates;
|
|||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for the Fate Table.
|
||||
/// </summary>
|
||||
internal class FateTableAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for the Fate Table.
|
||||
/// </summary>
|
||||
internal class FateTableAgingStep : IAgingStep
|
||||
private int index = 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test FateTable";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private int index = 0;
|
||||
var fateTable = Service<FateTable>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test FateTable";
|
||||
ImGui.Text("Checking fate table...");
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (this.index == fateTable.Length - 1)
|
||||
{
|
||||
var fateTable = Service<FateTable>.Get();
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
ImGui.Text("Checking fate table...");
|
||||
|
||||
if (this.index == fateTable.Length - 1)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
var actor = fateTable[this.index];
|
||||
this.index++;
|
||||
|
||||
if (actor == null)
|
||||
{
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
Util.ShowObject(actor);
|
||||
var actor = fateTable[this.index];
|
||||
this.index++;
|
||||
|
||||
if (actor == null)
|
||||
{
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
Util.ShowObject(actor);
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,36 @@
|
|||
using Dalamud.Game.ClientState.GamePad;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for the Gamepad State.
|
||||
/// </summary>
|
||||
internal class GamepadStateAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for the Gamepad State.
|
||||
/// </summary>
|
||||
internal class GamepadStateAgingStep : IAgingStep
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test GamePadState";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test GamePadState";
|
||||
var gamepadState = Service<GamepadState>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
ImGui.Text("Hold down North, East, L1");
|
||||
|
||||
if (gamepadState.Pressed(GamepadButtons.North) == 1
|
||||
&& gamepadState.Pressed(GamepadButtons.East) == 1
|
||||
&& gamepadState.Pressed(GamepadButtons.L1) == 1)
|
||||
{
|
||||
var gamepadState = Service<GamepadState>.Get();
|
||||
|
||||
ImGui.Text("Hold down North, East, L1");
|
||||
|
||||
if (gamepadState.Pressed(GamepadButtons.North) == 1
|
||||
&& gamepadState.Pressed(GamepadButtons.East) == 1
|
||||
&& gamepadState.Pressed(GamepadButtons.L1) == 1)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,34 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test dedicated to handling of Access Violations.
|
||||
/// </summary>
|
||||
internal class HandledExceptionAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test dedicated to handling of Access Violations.
|
||||
/// </summary>
|
||||
internal class HandledExceptionAgingStep : IAgingStep
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Handled Exception";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Handled Exception";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
Marshal.ReadByte(IntPtr.Zero);
|
||||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Fail;
|
||||
Marshal.ReadByte(IntPtr.Zero);
|
||||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
return SelfTestStepResult.Fail;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,58 +1,57 @@
|
|||
using Dalamud.Game.Gui;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for the Hover events.
|
||||
/// </summary>
|
||||
internal class HoverAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for the Hover events.
|
||||
/// </summary>
|
||||
internal class HoverAgingStep : IAgingStep
|
||||
private bool clearedItem = false;
|
||||
private bool clearedAction = false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Hover";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private bool clearedItem = false;
|
||||
private bool clearedAction = false;
|
||||
var gameGui = Service<GameGui>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Hover";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (!this.clearedItem)
|
||||
{
|
||||
var gameGui = Service<GameGui>.Get();
|
||||
ImGui.Text("Hover WHM soul crystal...");
|
||||
|
||||
if (!this.clearedItem)
|
||||
if (gameGui.HoveredItem == 4547)
|
||||
{
|
||||
ImGui.Text("Hover WHM soul crystal...");
|
||||
|
||||
if (gameGui.HoveredItem == 4547)
|
||||
{
|
||||
this.clearedItem = true;
|
||||
}
|
||||
this.clearedItem = true;
|
||||
}
|
||||
|
||||
if (!this.clearedAction)
|
||||
{
|
||||
ImGui.Text("Hover \"Open Linkshells\" action...");
|
||||
|
||||
if (gameGui.HoveredAction != null &&
|
||||
gameGui.HoveredAction.ActionKind == HoverActionKind.MainCommand &&
|
||||
gameGui.HoveredAction.ActionID == 28)
|
||||
{
|
||||
this.clearedAction = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.clearedItem && this.clearedAction)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
if (!this.clearedAction)
|
||||
{
|
||||
// ignored
|
||||
ImGui.Text("Hover \"Open Linkshells\" action...");
|
||||
|
||||
if (gameGui.HoveredAction != null &&
|
||||
gameGui.HoveredAction.ActionKind == HoverActionKind.MainCommand &&
|
||||
gameGui.HoveredAction.ActionID == 28)
|
||||
{
|
||||
this.clearedAction = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.clearedItem && this.clearedAction)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Interface for test implementations.
|
||||
/// </summary>
|
||||
internal interface IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface for test implementations.
|
||||
/// Gets the name of the test.
|
||||
/// </summary>
|
||||
internal interface IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the test.
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Run the test step, once per frame it is active.
|
||||
/// </summary>
|
||||
/// <returns>The result of this frame, test is discarded once a result other than <see cref="SelfTestStepResult.Waiting"/> is returned.</returns>
|
||||
public SelfTestStepResult RunStep();
|
||||
/// <summary>
|
||||
/// Run the test step, once per frame it is active.
|
||||
/// </summary>
|
||||
/// <returns>The result of this frame, test is discarded once a result other than <see cref="SelfTestStepResult.Waiting"/> is returned.</returns>
|
||||
public SelfTestStepResult RunStep();
|
||||
|
||||
/// <summary>
|
||||
/// Clean up this test.
|
||||
/// </summary>
|
||||
public void CleanUp();
|
||||
}
|
||||
/// <summary>
|
||||
/// Clean up this test.
|
||||
/// </summary>
|
||||
public void CleanUp();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,38 @@
|
|||
using Dalamud.Game.ClientState.Keys;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for the Key State.
|
||||
/// </summary>
|
||||
internal class KeyStateAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for the Key State.
|
||||
/// </summary>
|
||||
internal class KeyStateAgingStep : IAgingStep
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test KeyState";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test KeyState";
|
||||
var keyState = Service<KeyState>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
ImGui.Text("Hold down D,A,L,M,U");
|
||||
|
||||
if (keyState[VirtualKey.D]
|
||||
&& keyState[VirtualKey.A]
|
||||
&& keyState[VirtualKey.L]
|
||||
&& keyState[VirtualKey.M]
|
||||
&& keyState[VirtualKey.U])
|
||||
{
|
||||
var keyState = Service<KeyState>.Get();
|
||||
|
||||
ImGui.Text("Hold down D,A,L,M,U");
|
||||
|
||||
if (keyState[VirtualKey.D]
|
||||
&& keyState[VirtualKey.A]
|
||||
&& keyState[VirtualKey.L]
|
||||
&& keyState[VirtualKey.M]
|
||||
&& keyState[VirtualKey.U])
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,57 +3,56 @@ using System;
|
|||
using Dalamud.Game.ClientState;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for the login events.
|
||||
/// </summary>
|
||||
internal class LoginEventAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for the login events.
|
||||
/// </summary>
|
||||
internal class LoginEventAgingStep : IAgingStep
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Log-In";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Log-In";
|
||||
ImGui.Text("Log in now...");
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (!this.subscribed)
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
ImGui.Text("Log in now...");
|
||||
|
||||
if (!this.subscribed)
|
||||
{
|
||||
clientState.Login += this.ClientStateOnOnLogin;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
if (this.hasPassed)
|
||||
{
|
||||
clientState.Login -= this.ClientStateOnOnLogin;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
clientState.Login += this.ClientStateOnOnLogin;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
if (this.hasPassed)
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
if (this.subscribed)
|
||||
{
|
||||
clientState.Login -= this.ClientStateOnOnLogin;
|
||||
this.subscribed = false;
|
||||
}
|
||||
clientState.Login -= this.ClientStateOnOnLogin;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
private void ClientStateOnOnLogin(object sender, EventArgs e)
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
if (this.subscribed)
|
||||
{
|
||||
this.hasPassed = true;
|
||||
clientState.Login -= this.ClientStateOnOnLogin;
|
||||
this.subscribed = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void ClientStateOnOnLogin(object sender, EventArgs e)
|
||||
{
|
||||
this.hasPassed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,57 +3,56 @@ using System;
|
|||
using Dalamud.Game.ClientState;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for the login events.
|
||||
/// </summary>
|
||||
internal class LogoutEventAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for the login events.
|
||||
/// </summary>
|
||||
internal class LogoutEventAgingStep : IAgingStep
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Log-In";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Log-In";
|
||||
ImGui.Text("Log out now...");
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (!this.subscribed)
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
ImGui.Text("Log out now...");
|
||||
|
||||
if (!this.subscribed)
|
||||
{
|
||||
clientState.Logout += this.ClientStateOnOnLogout;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
if (this.hasPassed)
|
||||
{
|
||||
clientState.Logout -= this.ClientStateOnOnLogout;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
clientState.Logout += this.ClientStateOnOnLogout;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
if (this.hasPassed)
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
if (this.subscribed)
|
||||
{
|
||||
clientState.Logout -= this.ClientStateOnOnLogout;
|
||||
this.subscribed = false;
|
||||
}
|
||||
clientState.Logout -= this.ClientStateOnOnLogout;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
private void ClientStateOnOnLogout(object sender, EventArgs e)
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
var clientState = Service<ClientState>.Get();
|
||||
|
||||
if (this.subscribed)
|
||||
{
|
||||
this.hasPassed = true;
|
||||
clientState.Logout -= this.ClientStateOnOnLogout;
|
||||
this.subscribed = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void ClientStateOnOnLogout(object sender, EventArgs e)
|
||||
{
|
||||
this.hasPassed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,38 +5,37 @@ using Dalamud.Data;
|
|||
using Dalamud.Utility;
|
||||
using Lumina.Excel;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for Lumina.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">ExcelRow to run test on.</typeparam>
|
||||
internal class LuminaAgingStep<T> : IAgingStep
|
||||
where T : ExcelRow
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for Lumina.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">ExcelRow to run test on.</typeparam>
|
||||
internal class LuminaAgingStep<T> : IAgingStep
|
||||
where T : ExcelRow
|
||||
private int step = 0;
|
||||
private List<T> rows;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Lumina";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private int step = 0;
|
||||
private List<T> rows;
|
||||
var dataManager = Service<DataManager>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Lumina";
|
||||
this.rows ??= dataManager.GetExcelSheet<T>().ToList();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
var dataManager = Service<DataManager>.Get();
|
||||
Util.ShowObject(this.rows[this.step]);
|
||||
|
||||
this.rows ??= dataManager.GetExcelSheet<T>().ToList();
|
||||
this.step++;
|
||||
return this.step >= this.rows.Count ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
Util.ShowObject(this.rows[this.step]);
|
||||
|
||||
this.step++;
|
||||
return this.step >= this.rows.Count ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,57 +2,56 @@ using Dalamud.Game.Gui.PartyFinder;
|
|||
using Dalamud.Game.Gui.PartyFinder.Types;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for Party Finder events.
|
||||
/// </summary>
|
||||
internal class PartyFinderAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for Party Finder events.
|
||||
/// </summary>
|
||||
internal class PartyFinderAgingStep : IAgingStep
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Party Finder";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private bool subscribed = false;
|
||||
private bool hasPassed = false;
|
||||
var partyFinderGui = Service<PartyFinderGui>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Party Finder";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
if (!this.subscribed)
|
||||
{
|
||||
var partyFinderGui = Service<PartyFinderGui>.Get();
|
||||
|
||||
if (!this.subscribed)
|
||||
{
|
||||
partyFinderGui.ReceiveListing += this.PartyFinderOnReceiveListing;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
if (this.hasPassed)
|
||||
{
|
||||
partyFinderGui.ReceiveListing -= this.PartyFinderOnReceiveListing;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
ImGui.Text("Open Party Finder");
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
partyFinderGui.ReceiveListing += this.PartyFinderOnReceiveListing;
|
||||
this.subscribed = true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
if (this.hasPassed)
|
||||
{
|
||||
var partyFinderGui = Service<PartyFinderGui>.Get();
|
||||
|
||||
if (this.subscribed)
|
||||
{
|
||||
partyFinderGui.ReceiveListing -= this.PartyFinderOnReceiveListing;
|
||||
this.subscribed = false;
|
||||
}
|
||||
partyFinderGui.ReceiveListing -= this.PartyFinderOnReceiveListing;
|
||||
this.subscribed = false;
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
private void PartyFinderOnReceiveListing(PartyFinderListing listing, PartyFinderListingEventArgs args)
|
||||
ImGui.Text("Open Party Finder");
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
var partyFinderGui = Service<PartyFinderGui>.Get();
|
||||
|
||||
if (this.subscribed)
|
||||
{
|
||||
this.hasPassed = true;
|
||||
partyFinderGui.ReceiveListing -= this.PartyFinderOnReceiveListing;
|
||||
this.subscribed = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void PartyFinderOnReceiveListing(PartyFinderListing listing, PartyFinderListingEventArgs args)
|
||||
{
|
||||
this.hasPassed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,74 +3,73 @@ using Dalamud.Game.ClientState.Objects.SubKinds;
|
|||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for targets.
|
||||
/// </summary>
|
||||
internal class TargetAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for targets.
|
||||
/// </summary>
|
||||
internal class TargetAgingStep : IAgingStep
|
||||
private int step = 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Target";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
private int step = 0;
|
||||
var targetManager = Service<TargetManager>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Target";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
switch (this.step)
|
||||
{
|
||||
var targetManager = Service<TargetManager>.Get();
|
||||
case 0:
|
||||
targetManager.ClearTarget();
|
||||
targetManager.ClearFocusTarget();
|
||||
|
||||
switch (this.step)
|
||||
{
|
||||
case 0:
|
||||
targetManager.ClearTarget();
|
||||
targetManager.ClearFocusTarget();
|
||||
this.step++;
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
ImGui.Text("Target a player...");
|
||||
|
||||
var cTarget = targetManager.Target;
|
||||
if (cTarget is PlayerCharacter)
|
||||
{
|
||||
this.step++;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
ImGui.Text("Target a player...");
|
||||
case 2:
|
||||
ImGui.Text("Focus-Target a Battle NPC...");
|
||||
|
||||
var cTarget = targetManager.Target;
|
||||
if (cTarget is PlayerCharacter)
|
||||
{
|
||||
this.step++;
|
||||
}
|
||||
var fTarget = targetManager.FocusTarget;
|
||||
if (fTarget is BattleNpc)
|
||||
{
|
||||
this.step++;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ImGui.Text("Focus-Target a Battle NPC...");
|
||||
case 3:
|
||||
ImGui.Text("Soft-Target an EventObj...");
|
||||
|
||||
var fTarget = targetManager.FocusTarget;
|
||||
if (fTarget is BattleNpc)
|
||||
{
|
||||
this.step++;
|
||||
}
|
||||
var sTarget = targetManager.FocusTarget;
|
||||
if (sTarget is EventObj)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
ImGui.Text("Soft-Target an EventObj...");
|
||||
|
||||
var sTarget = targetManager.FocusTarget;
|
||||
if (sTarget is EventObj)
|
||||
{
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Waiting;
|
||||
break;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
return SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,29 @@
|
|||
using Dalamud.Game.Gui.Toast;
|
||||
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test setup for toasts.
|
||||
/// </summary>
|
||||
internal class ToastAgingStep : IAgingStep
|
||||
{
|
||||
/// <summary>
|
||||
/// Test setup for toasts.
|
||||
/// </summary>
|
||||
internal class ToastAgingStep : IAgingStep
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Toasts";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public string Name => "Test Toasts";
|
||||
var toastGui = Service<ToastGui>.Get();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
var toastGui = Service<ToastGui>.Get();
|
||||
toastGui.ShowNormal("Normal Toast");
|
||||
toastGui.ShowError("Error Toast");
|
||||
|
||||
toastGui.ShowNormal("Normal Toast");
|
||||
toastGui.ShowError("Error Toast");
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
return SelfTestStepResult.Pass;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,37 @@
|
|||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps
|
||||
namespace Dalamud.Interface.Internal.Windows.SelfTest.AgingSteps;
|
||||
|
||||
/// <summary>
|
||||
/// Test that waits N frames.
|
||||
/// </summary>
|
||||
internal class WaitFramesAgingStep : IAgingStep
|
||||
{
|
||||
private readonly int frames;
|
||||
private int cFrames;
|
||||
|
||||
/// <summary>
|
||||
/// Test that waits N frames.
|
||||
/// Initializes a new instance of the <see cref="WaitFramesAgingStep"/> class.
|
||||
/// </summary>
|
||||
internal class WaitFramesAgingStep : IAgingStep
|
||||
/// <param name="frames">Amount of frames to wait.</param>
|
||||
public WaitFramesAgingStep(int frames)
|
||||
{
|
||||
private readonly int frames;
|
||||
private int cFrames;
|
||||
this.frames = frames;
|
||||
this.cFrames = frames;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaitFramesAgingStep"/> class.
|
||||
/// </summary>
|
||||
/// <param name="frames">Amount of frames to wait.</param>
|
||||
public WaitFramesAgingStep(int frames)
|
||||
{
|
||||
this.frames = frames;
|
||||
this.cFrames = frames;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public string Name => $"Wait {this.cFrames} frames";
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name => $"Wait {this.cFrames} frames";
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
this.cFrames--;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SelfTestStepResult RunStep()
|
||||
{
|
||||
this.cFrames--;
|
||||
return this.cFrames <= 0 ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
return this.cFrames <= 0 ? SelfTestStepResult.Pass : SelfTestStepResult.Waiting;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
this.cFrames = this.frames;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public void CleanUp()
|
||||
{
|
||||
this.cFrames = this.frames;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue