using Artemis.Core;
namespace Artemis.UI.Shared.Services.ProfileEditor.Commands;
///
/// Represents a profile editor command that can be used to update an static condition's play mode.
///
public class UpdateStaticStopMode : IProfileEditorCommand
{
private readonly StaticCondition _staticCondition;
private readonly StaticStopMode _value;
private readonly StaticStopMode _oldValue;
///
/// Creates a new instance of the class.
///
public UpdateStaticStopMode(StaticCondition staticCondition, StaticStopMode value)
{
_staticCondition = staticCondition;
_value = value;
_oldValue = staticCondition.StopMode;
}
///
public string DisplayName => "Update condition stop mode";
///
public void Execute()
{
_staticCondition.StopMode = _value;
}
///
public void Undo()
{
_staticCondition.StopMode = _oldValue;
}
}