using Newtonsoft.Json; using RhythmBase.Components; using System.Diagnostics; namespace RhythmBase.Events { /// /// Represents an event that advances text in a room. /// [DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")] public class AdvanceText : BaseEvent, IRoomEvent,IDurationEvent { /// /// Initializes a new instance of the class. /// public AdvanceText() { } /// public override EventType Type { get; } = EventType.AdvanceText; /// [JsonIgnore] public RDRoom Rooms { get => Parent.Rooms; set => Parent.Rooms = value; } /// public override Tabs Tab { get; } = Tabs.Actions; /// /// Gets or sets the parent floating text associated with the event. /// [JsonIgnore] public FloatingText Parent { get; internal set; } = new(); /// /// Gets or sets the fade-out duration for the text. /// [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float FadeOutDuration { get; set; } float IDurationEvent.Duration => FadeOutDuration; /// /// Gets the ID of the parent floating text. /// [JsonProperty] private int Id => Parent.Id; /// public override string ToString() => base.ToString() + $" Index:{Parent.Children.IndexOf(this)}"; private string GetDebuggerDisplay() => ToString(); } }