using Newtonsoft.Json;
namespace RhythmBase.Components
{
///
/// Represents a base class for different types of conditions.
///
public abstract class BaseConditional
{
///
/// Gets the type of this condition.
///
public abstract ConditionType Type { get; }
///
/// Gets or sets the condition tag. Its role has not been clarified.
///
public string Tag { get; set; } = "";
///
/// Gets or sets the condition name.
///
public string Name { get; set; } = "";
///
/// Gets the 1-based serial number of this condition in the parent collection.
///
public int Id => checked(ParentCollection.IndexOf(this) + 1);
///
/// Returns the name of the condition.
///
/// The name of the condition.
public override string ToString() => Name;
///
/// Gets or sets the parent collection of conditions.
///
[JsonIgnore]
internal List ParentCollection = [];
///
/// Specifies the type of condition.
///
public enum ConditionType
{
///
/// Condition based on the last hit.
///
LastHit,
///
/// Custom condition.
///
Custom,
///
/// Condition based on the number of times executed.
///
TimesExecuted,
///
/// Condition based on the language.
///
Language,
///
/// Condition based on the player mode.
///
PlayerMode
}
}
}