using System;
namespace IntroSkipper.Data;
///
/// Represents the state of an episode regarding analysis and blacklist status.
///
public class EpisodeState
{
private readonly bool[] _analyzedStates = new bool[2];
private readonly bool[] _blacklistedStates = new bool[2];
///
/// Checks if the specified analysis mode has been analyzed.
///
/// The analysis mode to check.
/// True if the mode has been analyzed, false otherwise.
public bool IsAnalyzed(AnalysisMode mode) => _analyzedStates[(int)mode];
///
/// Sets the analyzed state for the specified analysis mode.
///
/// The analysis mode to set.
/// The analyzed state to set.
public void SetAnalyzed(AnalysisMode mode, bool value) => _analyzedStates[(int)mode] = value;
///
/// Checks if the specified analysis mode has been blacklisted.
///
/// The analysis mode to check.
/// True if the mode has been blacklisted, false otherwise.
public bool IsBlacklisted(AnalysisMode mode) => _blacklistedStates[(int)mode];
///
/// Sets the blacklisted state for the specified analysis mode.
///
/// The analysis mode to set.
/// The blacklisted state to set.
public void SetBlacklisted(AnalysisMode mode, bool value) => _blacklistedStates[(int)mode] = value;
///
/// Resets the analyzed states.
///
public void ResetStates()
{
Array.Clear(_analyzedStates);
Array.Clear(_blacklistedStates);
}
}