using Newtonsoft.Json;
namespace RhythmBase.Events
{
///
/// Represents an event to show a status sign.
///
public class ShowStatusSign : BaseEvent
{
///
/// Initializes a new instance of the class.
///
public ShowStatusSign()
{
UseBeats = true;
Narrate = true;
Type = EventType.ShowStatusSign;
Tab = Tabs.Actions;
}
///
/// Gets or sets a value indicating whether to use beats.
///
public bool UseBeats { get; set; }
///
/// Gets or sets a value indicating whether to narrate.
///
public bool Narrate { get; set; }
///
/// Gets or sets the text to display.
///
public string Text { get; set; } = "";
///
/// Gets or sets the duration of the status sign in seconds.
///
public float Duration { get; set; }
///
/// Gets or sets the duration of the status sign as a .
///
[JsonIgnore]
public TimeSpan TimeDuration
{
get
{
bool useBeats = UseBeats;
TimeSpan TimeDuration;
if (useBeats)
{
TimeDuration = TimeSpan.Zero;
}
else
{
TimeDuration = TimeSpan.FromSeconds((double)Duration);
}
return TimeDuration;
}
set
{
UseBeats = false;
Duration = (float)value.TotalSeconds;
}
}
///
/// Gets the type of the event.
///
public override EventType Type { get; }
///
/// Gets the tab of the event.
///
public override Tabs Tab { get; }
///
/// Returns a string that represents the current object.
///
/// A string that represents the current object.
public override string ToString() => base.ToString() + string.Format(" {0}", Text);
}
}