Archived
forked from RDTKEditor/RDTKEditor
添加对 Core 的直接引用
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Extensions;
|
||||
using System.Diagnostics;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to add a classic beat.
|
||||
/// </summary>
|
||||
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")]
|
||||
public class AddClassicBeat : BaseBeat
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AddClassicBeat"/> class.
|
||||
/// </summary>
|
||||
public AddClassicBeat() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tick value.
|
||||
/// </summary>
|
||||
public float Tick { get; set; } = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the swing value.
|
||||
/// </summary>
|
||||
public float Swing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the hold value.
|
||||
/// </summary>
|
||||
public float Hold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the classic beat pattern.
|
||||
/// </summary>
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public ClassicBeatPatterns? SetXs { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public override EventType Type { get; } = EventType.AddClassicBeat;
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => base.ToString() +
|
||||
$" {Utils.Utils.GetPatternString(this.RowXs())} {((Swing is 0.5f or 0f) ? "" : " Swing")}";
|
||||
|
||||
/// <summary>
|
||||
/// Defines the classic beat patterns.
|
||||
/// </summary>
|
||||
public enum ClassicBeatPatterns
|
||||
{
|
||||
/// <summary>
|
||||
/// No change in the beat pattern.
|
||||
/// </summary>
|
||||
NoChange,
|
||||
|
||||
/// <summary>
|
||||
/// Three beat pattern.
|
||||
/// </summary>
|
||||
ThreeBeat,
|
||||
|
||||
/// <summary>
|
||||
/// Four beat pattern.
|
||||
/// </summary>
|
||||
FourBeat
|
||||
}
|
||||
private string GetDebuggerDisplay() => ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to add a free time beat.
|
||||
/// </summary>
|
||||
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")]
|
||||
public class AddFreeTimeBeat : BaseBeat
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AddFreeTimeBeat"/> class.
|
||||
/// </summary>
|
||||
public AddFreeTimeBeat() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the hold duration of the beat.
|
||||
/// </summary>
|
||||
public float Hold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pulse value of the beat.
|
||||
/// </summary>
|
||||
public byte Pulse { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public override EventType Type { get; } = EventType.AddFreeTimeBeat;
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => base.ToString() + $" {(Pulse + 1)}";
|
||||
private string GetDebuggerDisplay() => ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to add a one-shot beat.
|
||||
/// </summary>
|
||||
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")]
|
||||
public class AddOneshotBeat : BaseBeat
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AddOneshotBeat"/> class.
|
||||
/// </summary>
|
||||
public AddOneshotBeat() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of pulse.
|
||||
/// </summary>
|
||||
public Pulse PulseType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of subdivisions.
|
||||
/// </summary>
|
||||
public byte Subdivisions { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the subdivision sound is enabled.
|
||||
/// </summary>
|
||||
public bool SubdivSound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tick value.
|
||||
/// </summary>
|
||||
public float Tick { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of loops.
|
||||
/// </summary>
|
||||
public uint Loops { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interval value.
|
||||
/// </summary>
|
||||
public float Interval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to skip the shot.
|
||||
/// </summary>
|
||||
public bool Skipshot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the freeze burn mode.
|
||||
/// </summary>
|
||||
public FreezeBurn? FreezeBurnMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the delay value.
|
||||
/// </summary>
|
||||
public float Delay
|
||||
{
|
||||
get => _delay;
|
||||
set => _delay = FreezeBurnMode != FreezeBurn.Freezeshot
|
||||
? 0f : value <= 0f
|
||||
? 0.5f : value;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public override EventType Type { get; } = EventType.AddOneshotBeat;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => base.ToString() + $" {FreezeBurnMode} {PulseType}";
|
||||
|
||||
private float _delay = 0f;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the type of pulse.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The pulse type determines the shape of the beat's waveform.
|
||||
/// </remarks>
|
||||
public enum Pulse
|
||||
{
|
||||
/// <summary>
|
||||
/// A wave pulse.
|
||||
/// </summary>
|
||||
Wave,
|
||||
|
||||
/// <summary>
|
||||
/// A square pulse.
|
||||
/// </summary>
|
||||
Square,
|
||||
|
||||
/// <summary>
|
||||
/// A triangle pulse.
|
||||
/// </summary>
|
||||
Triangle,
|
||||
|
||||
/// <summary>
|
||||
/// A heart-shaped pulse.
|
||||
/// </summary>
|
||||
Heart
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the freeze burn mode.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The freeze burn mode determines the effect applied to the beat.
|
||||
/// </remarks>
|
||||
public enum FreezeBurn
|
||||
{
|
||||
/// <summary>
|
||||
/// A wave freeze burn mode.
|
||||
/// </summary>
|
||||
Wave,
|
||||
|
||||
/// <summary>
|
||||
/// A freeze shot mode.
|
||||
/// </summary>
|
||||
Freezeshot,
|
||||
|
||||
/// <summary>
|
||||
/// A burn shot mode.
|
||||
/// </summary>
|
||||
Burnshot
|
||||
}
|
||||
private string GetDebuggerDisplay() => ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using System.Diagnostics;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that advances text in a room.
|
||||
/// </summary>
|
||||
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")]
|
||||
public class AdvanceText : BaseEvent, IRoomEvent,IDurationEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AdvanceText"/> class.
|
||||
/// </summary>
|
||||
public AdvanceText() { }
|
||||
/// <inheritdoc/>
|
||||
public override EventType Type { get; } = EventType.AdvanceText;
|
||||
/// <inheritdoc/>
|
||||
[JsonIgnore]
|
||||
public RDRoom Rooms
|
||||
{
|
||||
get => Parent.Rooms;
|
||||
set => Parent.Rooms = value;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public override Tabs Tab { get; } = Tabs.Actions;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parent floating text associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public FloatingText Parent { get; internal set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the fade-out duration for the text.
|
||||
/// </summary>
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public float FadeOutDuration { get; set; }
|
||||
float IDurationEvent.Duration => FadeOutDuration;
|
||||
/// <summary>
|
||||
/// Gets the ID of the parent floating text.
|
||||
/// </summary>
|
||||
[JsonProperty]
|
||||
private int Id => Parent.Id;
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => base.ToString() + $" Index:{Parent.Children.IndexOf(this)}";
|
||||
private string GetDebuggerDisplay() => ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an abstract base class for beat actions in a rhythm-based application.
|
||||
/// </summary>
|
||||
public abstract class BaseBeat : BaseRowAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseBeat"/> class and sets the Tab property to Rows.
|
||||
/// </summary>
|
||||
protected BaseBeat() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the beat action, which is always set to Rows.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; } = Tabs.Rows;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Extensions;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the base class for events that have a beats per minute (BPM) value.
|
||||
/// </summary>
|
||||
public abstract class BaseBeatsPerMinute : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseBeatsPerMinute"/> class with a default BPM of 100.
|
||||
/// </summary>
|
||||
protected BaseBeatsPerMinute()
|
||||
{
|
||||
_bpm = Utils.Utils.DefaultBPM;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the beat associated with this event.
|
||||
/// </summary>
|
||||
public override RDBeat Beat
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Beat;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Beat = value;
|
||||
ResetTimeLine();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the beats per minute (BPM) for this event.
|
||||
/// </summary>
|
||||
public virtual float BeatsPerMinute
|
||||
{
|
||||
get
|
||||
{
|
||||
return _bpm;
|
||||
}
|
||||
set
|
||||
{
|
||||
_bpm = value;
|
||||
ResetTimeLine();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the timeline for all events in the same level that occur after this event.
|
||||
/// </summary>
|
||||
private void ResetTimeLine()
|
||||
{
|
||||
if (Beat.BaseLevel != null)
|
||||
{
|
||||
foreach (IBaseEvent item in from i in Beat.BaseLevel
|
||||
where i.Beat > Beat
|
||||
select i)
|
||||
{
|
||||
item.Beat.ResetBPM();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float _bpm;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the base class for decoration actions in the rhythm base.
|
||||
/// </summary>
|
||||
public abstract class BaseDecorationAction : BaseEvent, IBaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the parent decoration event collection.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public DecorationEventCollection? Parent => _parent;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Y coordinate.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public override int Y { get => base.Y; set => base.Y = value; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target identifier.
|
||||
/// </summary>
|
||||
public virtual string Target => Parent?.Id ?? "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the beat associated with this action.
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
[JsonIgnore]
|
||||
public override RDBeat Beat
|
||||
{
|
||||
get => _beat;
|
||||
set => _beat = _beat.BaseLevel == null ?
|
||||
value.BaseLevel == null ?
|
||||
value :
|
||||
value.WithoutBinding() :
|
||||
new(_beat.BaseLevel.Calculator, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones this event and its basic properties. The clone will be added to the level.
|
||||
/// </summary>
|
||||
/// <typeparam name="TEvent">The type of event that will be generated.</typeparam>
|
||||
/// <returns>A new instance of <typeparamref name="TEvent"/>.</returns>
|
||||
public new TEvent Clone<TEvent>() where TEvent : BaseDecorationAction, new()
|
||||
{
|
||||
TEvent Temp = base.Clone<TEvent>();
|
||||
Temp._parent = Parent;
|
||||
return Temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones this event and its basic properties, associating it with a specific decoration event collection.
|
||||
/// </summary>
|
||||
/// <typeparam name="TEvent">The type of event that will be generated.</typeparam>
|
||||
/// <param name="decoration">The decoration event collection to associate with the clone.</param>
|
||||
/// <returns>A new instance of <typeparamref name="TEvent"/>.</returns>
|
||||
internal TEvent Clone<TEvent>(DecorationEventCollection decoration) where TEvent : BaseDecorationAction, new()
|
||||
{
|
||||
TEvent Temp = base.Clone<TEvent>(decoration.Parent ?? throw new RhythmBase.Exceptions.RhythmBaseException());
|
||||
Temp._parent = decoration;
|
||||
return Temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the room associated with this action.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDSingleRoom Room => Parent?.Room ?? RDSingleRoom.Default;
|
||||
|
||||
/// <summary>
|
||||
/// The parent decoration event collection.
|
||||
/// </summary>
|
||||
internal DecorationEventCollection? _parent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Utils;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// The base class of the event.
|
||||
/// All event types inherit directly or indirectly from this.
|
||||
/// </summary>
|
||||
public abstract class BaseEvent : IBaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// The base class of the event.
|
||||
/// All event types inherit directly or indirectly from this.
|
||||
/// </summary>
|
||||
protected BaseEvent()
|
||||
{
|
||||
_beat = new RDBeat(1f);
|
||||
Active = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// Event type.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public abstract EventType Type { get; }
|
||||
/// <summary>
|
||||
/// Column to which the event belongs.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public abstract Tabs Tab { get; }
|
||||
/// <summary>
|
||||
/// The beat of the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual RDBeat Beat
|
||||
{
|
||||
get => _beat;
|
||||
set
|
||||
{
|
||||
if (_beat.BaseLevel == null)
|
||||
_beat = value.BaseLevel == null ? value : value.WithoutBinding();
|
||||
else
|
||||
{
|
||||
value = new RDBeat(_beat.BaseLevel.Calculator, value);
|
||||
_beat.BaseLevel.Remove(this);
|
||||
value.BaseLevel?.Add(this);
|
||||
_beat = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// The number of rows this event is on.
|
||||
/// </summary>
|
||||
public virtual int Y { get; set; }
|
||||
/// <summary>
|
||||
/// Event tag.
|
||||
/// </summary>
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Tag { get; set; } = "";
|
||||
/// <summary>
|
||||
/// Event conditions.
|
||||
/// </summary>
|
||||
[JsonProperty("if", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public Condition? Condition { get; set; }
|
||||
/// <summary>
|
||||
/// Indicates whether this event is activated.
|
||||
/// </summary>
|
||||
public bool Active { get; set; }
|
||||
/// <summary>
|
||||
/// Clone this event and its basic properties.
|
||||
/// If it is of the same type as the source event, then it will be cloned.
|
||||
/// </summary>
|
||||
/// <typeparam name="TEvent">Type that will be generated.</typeparam>
|
||||
/// <returns>A new instance with the same base properties as the source instance.</returns>
|
||||
public virtual TEvent Clone<TEvent>() where TEvent : IBaseEvent, new()
|
||||
{
|
||||
if (EventTypeUtils.ToEnum<TEvent>() == Type)
|
||||
{
|
||||
TEvent e = (TEvent)MemberwiseClone();
|
||||
((BaseEvent)(object)e)._beat = Beat.WithoutBinding();
|
||||
return e;
|
||||
}
|
||||
TEvent temp = new()
|
||||
{
|
||||
Beat = Beat.WithoutBinding(),
|
||||
Y = Y,
|
||||
Tag = Tag,
|
||||
Condition = Condition,
|
||||
Active = Active
|
||||
};
|
||||
if (Condition != null)
|
||||
temp.Condition = new()
|
||||
{
|
||||
ConditionLists = [.. Condition.ConditionLists]
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
internal virtual TEvent Clone<TEvent>(RDLevel level) where TEvent : IBaseEvent, new()
|
||||
{
|
||||
TEvent temp = new()
|
||||
{
|
||||
Beat = Beat.WithoutBinding(),
|
||||
Y = Y,
|
||||
Tag = Tag,
|
||||
Condition = Condition,
|
||||
Active = Active
|
||||
};
|
||||
if (Condition != null)
|
||||
temp.Condition = new()
|
||||
{
|
||||
ConditionLists = [.. Condition.ConditionLists]
|
||||
};
|
||||
return temp;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => $"{Beat} {Type}";
|
||||
internal RDBeat _beat;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a base action for a row event.
|
||||
/// </summary>
|
||||
public abstract class BaseRowAction : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the parent row event collection.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RowEventCollection? Parent
|
||||
{
|
||||
get => _parent;
|
||||
internal set
|
||||
{
|
||||
if (_parent != null)
|
||||
{
|
||||
_parent.Remove(this);
|
||||
value?.Add(this);
|
||||
}
|
||||
_parent = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the room associated with this action.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDSingleRoom Room => _parent?.Rooms ?? RDSingleRoom.Default;
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets or sets the beat associated with this action.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public override RDBeat Beat
|
||||
{
|
||||
get => _beat;
|
||||
set
|
||||
{
|
||||
_beat = _beat.BaseLevel == null
|
||||
? value.BaseLevel == null
|
||||
? value
|
||||
: value.WithoutBinding()
|
||||
: new(_beat.BaseLevel.Calculator, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the row index. This function is obsolete and may be removed in the next release. Use Index instead.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
[Obsolete("This function is obsolete and may be removed in the next release. Use Index instead.")]
|
||||
public int Row { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index of the row in the parent collection.
|
||||
/// </summary>
|
||||
[JsonProperty("row", DefaultValueHandling = DefaultValueHandling.Include)]
|
||||
public int Index => Parent?.Index ?? -1;
|
||||
|
||||
/// <summary>
|
||||
/// Clones this event and its basic properties. Clone will be added to the level.
|
||||
/// </summary>
|
||||
/// <typeparam name="TEvent">Type that will be generated.</typeparam>
|
||||
/// <returns>A new instance of <typeparamref name="TEvent"/>.</returns>
|
||||
public new TEvent Clone<TEvent>() where TEvent : BaseRowAction, new()
|
||||
{
|
||||
TEvent Temp = base.Clone<TEvent>();
|
||||
Temp.Parent = Parent;
|
||||
return Temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones this event and assigns it to a specified row event collection.
|
||||
/// </summary>
|
||||
/// <typeparam name="TEvent">Type that will be generated.</typeparam>
|
||||
/// <param name="row">The row event collection to assign the clone to.</param>
|
||||
/// <returns>A new instance of <typeparamref name="TEvent"/>.</returns>
|
||||
internal TEvent Clone<TEvent>(RowEventCollection row) where TEvent : BaseRowAction, new()
|
||||
{
|
||||
TEvent Temp = base.Clone<TEvent>(row.Parent ?? throw new RhythmBase.Exceptions.RhythmBaseException());
|
||||
Temp.Parent = row;
|
||||
return Temp;
|
||||
}
|
||||
|
||||
internal RowEventCollection? _parent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the base class for row animations.
|
||||
/// </summary>
|
||||
public abstract class BaseRowAnimation : BaseRowAction, IBaseEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a BassDrop event in the rhythm base.
|
||||
/// </summary>
|
||||
public class BassDrop : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BassDrop"/> class.
|
||||
/// </summary>
|
||||
public BassDrop()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.BassDrop;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the strength of the BassDrop event.
|
||||
/// </summary>
|
||||
public StrengthType Strength { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public override EventType Type { get; }
|
||||
/// <inheritdoc/>
|
||||
public override Tabs Tab { get; }
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => base.ToString() + $" {Strength}";
|
||||
/// <summary>
|
||||
/// Defines the strength levels for the BassDrop event.
|
||||
/// </summary>
|
||||
public enum StrengthType
|
||||
{
|
||||
/// <summary>
|
||||
/// Low strength.
|
||||
/// </summary>
|
||||
Low,
|
||||
|
||||
/// <summary>
|
||||
/// Medium strength.
|
||||
/// </summary>
|
||||
Medium,
|
||||
|
||||
/// <summary>
|
||||
/// High strength.
|
||||
/// </summary>
|
||||
High
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the types of borders that can be applied.
|
||||
/// </summary>
|
||||
public enum Borders
|
||||
{
|
||||
/// <summary>
|
||||
/// No border.
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// An outline border.
|
||||
/// </summary>
|
||||
Outline,
|
||||
|
||||
/// <summary>
|
||||
/// A glowing border.
|
||||
/// </summary>
|
||||
Glow
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that calls a custom method.
|
||||
/// </summary>
|
||||
public partial class CallCustomMethod : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CallCustomMethod"/> class.
|
||||
/// </summary>
|
||||
public CallCustomMethod() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the method to be called.
|
||||
/// </summary>
|
||||
public string MethodName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the execution time of the method.
|
||||
/// </summary>
|
||||
public ExecutionTimeOptions ExecutionTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sort offset for the event.
|
||||
/// </summary>
|
||||
public int SortOffset { get; set; }
|
||||
/// <inheritdoc/>
|
||||
public override EventType Type { get; } = EventType.CallCustomMethod;
|
||||
/// <inheritdoc/>
|
||||
[JsonIgnore]
|
||||
public RDRoom Rooms { get; set; } = RDRoom.Default();
|
||||
/// <inheritdoc/>
|
||||
public override Tabs Tab { get; } = Tabs.Actions;
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => base.ToString() + $" {MethodName}";
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the execution time options for the method.
|
||||
/// </summary>
|
||||
public enum ExecutionTimeOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Execute the method on prebar.
|
||||
/// </summary>
|
||||
OnPrebar,
|
||||
|
||||
/// <summary>
|
||||
/// Execute the method on bar.
|
||||
/// </summary>
|
||||
OnBar
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class ChangePlayersRows : BaseEvent
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public ChangePlayersRows()
|
||||
{
|
||||
Players = new List<PlayerType>(16);
|
||||
CpuMarkers = new List<CpuType>(16);
|
||||
Type = EventType.ChangePlayersRows;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of players.
|
||||
/// </summary>
|
||||
public List<PlayerType> Players { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the player mode.
|
||||
/// </summary>
|
||||
public PlayerModes PlayerMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of CPU markers.
|
||||
/// </summary>
|
||||
public List<CpuType> CpuMarkers { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents the types of CPUs.
|
||||
/// </summary>
|
||||
public enum CpuType
|
||||
{
|
||||
/// <summary>
|
||||
/// No CPU.
|
||||
/// </summary>
|
||||
None,
|
||||
/// <summary>
|
||||
/// Otto CPU type.
|
||||
/// </summary>
|
||||
Otto,
|
||||
/// <summary>
|
||||
/// Ian CPU type.
|
||||
/// </summary>
|
||||
Ian,
|
||||
/// <summary>
|
||||
/// Paige CPU type.
|
||||
/// </summary>
|
||||
Paige,
|
||||
/// <summary>
|
||||
/// Edega CPU type.
|
||||
/// </summary>
|
||||
Edega,
|
||||
/// <summary>
|
||||
/// Blank CPU type.
|
||||
/// </summary>
|
||||
BlankCPU,
|
||||
/// <summary>
|
||||
/// Samurai CPU type.
|
||||
/// </summary>
|
||||
Samurai
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the modes of players.
|
||||
/// </summary>
|
||||
public enum PlayerModes
|
||||
{
|
||||
/// <summary>
|
||||
/// Single player mode.
|
||||
/// </summary>
|
||||
OnePlayer,
|
||||
/// <summary>
|
||||
/// Two players mode.
|
||||
/// </summary>
|
||||
TwoPlayers
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Comment : BaseDecorationAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Comment"/> class.
|
||||
/// </summary>
|
||||
public Comment()
|
||||
{
|
||||
Text = "";
|
||||
Color = new PaletteColor(false)
|
||||
{
|
||||
Color = RDColor.FromRgba(242, 230, 68)
|
||||
};
|
||||
Type = EventType.Comment;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the custom tab.
|
||||
/// </summary>
|
||||
[JsonProperty("tab")]
|
||||
public Tabs CustomTab { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public override Tabs Tab => CustomTab;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Comment"/> is shown.
|
||||
/// </summary>
|
||||
public bool Show { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text of the comment.
|
||||
/// </summary>
|
||||
public string Text { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string Target => base.Target;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the comment.
|
||||
/// </summary>
|
||||
public PaletteColor Color { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Text);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the different modes for content display.
|
||||
/// </summary>
|
||||
public enum ContentModes
|
||||
{
|
||||
/// <summary>
|
||||
/// Scales the content to fill the available space.
|
||||
/// </summary>
|
||||
ScaleToFill,
|
||||
|
||||
/// <summary>
|
||||
/// Scales the content to fit within the available space while maintaining the aspect ratio.
|
||||
/// </summary>
|
||||
AspectFit,
|
||||
|
||||
/// <summary>
|
||||
/// Scales the content to fill the available space while maintaining the aspect ratio.
|
||||
/// </summary>
|
||||
AspectFill,
|
||||
|
||||
/// <summary>
|
||||
/// Centers the content within the available space without scaling.
|
||||
/// </summary>
|
||||
Center,
|
||||
|
||||
/// <summary>
|
||||
/// Tiles the content to fill the available space.
|
||||
/// </summary>
|
||||
Tiled
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Exceptions;
|
||||
using RhythmBase.Extensions;
|
||||
using RhythmBase.Settings;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class CustomDecorationEvent : BaseDecorationAction
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actual type of the decoration event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string ActureType
|
||||
{
|
||||
get
|
||||
{
|
||||
return Data["Type".ToLowerCamelCase()]?.ToString() ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomDecorationEvent"/> class.
|
||||
/// </summary>
|
||||
public CustomDecorationEvent()
|
||||
{
|
||||
Data = [];
|
||||
Type = EventType.CustomDecorationEvent;
|
||||
Tab = Tabs.Decorations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomDecorationEvent"/> class with the specified data.
|
||||
/// </summary>
|
||||
/// <param name="data">The JSON data for the event.</param>
|
||||
public CustomDecorationEvent(JObject data)
|
||||
{
|
||||
Data = data ?? [];
|
||||
Type = EventType.CustomDecorationEvent;
|
||||
Tab = Tabs.Decorations;
|
||||
Beat = new RDBeat(Data["bar"]?.ToObject<uint>() ?? 1, (Data["beat"]?.ToObject<float>() ?? 1f));
|
||||
Tag = Data["tag"]?.ToObject<string>() ?? "";
|
||||
Condition = Data["condition"] != null
|
||||
? Data["condition"] is null ? null : Condition.Load(Data["condition"]!.ToObject<string>() ?? "")
|
||||
: null;
|
||||
Active = Data["active"]?.ToObject<bool>() ?? true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => $"{Beat} *{ActureType}";
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual bool TryConvert(ref BaseEvent value, ref EventType? type) => TryConvert(ref value, ref type, new LevelReadOrWriteSettings());
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual bool TryConvert(ref BaseEvent value, ref EventType? type, LevelReadOrWriteSettings settings) => TryConvert(ref value, ref type, settings);
|
||||
|
||||
/// <summary>
|
||||
/// Explicit conversion from <see cref="CustomEvent"/> to <see cref="CustomDecorationEvent"/>.
|
||||
/// </summary>
|
||||
/// <param name="e">The <see cref="CustomEvent"/> instance.</param>
|
||||
/// <exception cref="RhythmBaseException">Thrown when the row field is missing from the data.</exception>
|
||||
public static explicit operator CustomDecorationEvent(CustomEvent e)
|
||||
{
|
||||
return e.Data["row"] != null
|
||||
? new CustomDecorationEvent(e.Data)
|
||||
: throw new RhythmBaseException("The row field is missing from the field contained in this object.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JSON data for the event.
|
||||
/// </summary>
|
||||
public JObject Data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Extensions;
|
||||
using RhythmBase.Settings;
|
||||
using RhythmBase.Utils;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a custom event in the rhythm base system.
|
||||
/// </summary>
|
||||
public class CustomEvent : BaseEvent
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
[JsonIgnore]
|
||||
public override EventType Type => EventType.CustomEvent;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the actual type of the custom event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string ActureType
|
||||
{
|
||||
get => Data["Type".ToLowerCamelCase()]?.ToObject<string>() ?? "";
|
||||
init => Data["Type".ToLowerCamelCase()] = value;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int Y
|
||||
{
|
||||
get => (int)(Data["Y".ToLowerCamelCase()] ?? 0);
|
||||
set => Data["Y".ToLowerCamelCase()] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomEvent"/> class.
|
||||
/// </summary>
|
||||
public CustomEvent()
|
||||
{
|
||||
Data = [];
|
||||
Tab = Tabs.Unknown;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomEvent"/> class with the specified data.
|
||||
/// </summary>
|
||||
/// <param name="data">The data for the custom event.</param>
|
||||
public CustomEvent(JObject data)
|
||||
{
|
||||
Data = data ?? [];
|
||||
Tab = Tabs.Unknown;
|
||||
Beat = new RDBeat(Data["bar"]?.ToObject<uint>() ?? 1, Data["beat"]?.ToObject<float>() ?? 1f);
|
||||
Tag = Data["tag"]?.ToObject<string>() ?? "";
|
||||
Condition = Data["condition"] == null
|
||||
? null
|
||||
: Condition.Load(Data["condition"]?.ToObject<string>() ?? "");
|
||||
Active = Data["active"]?.ToObject<bool>() ?? true;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => $"{Beat} *{ActureType}";
|
||||
|
||||
/// <summary>
|
||||
/// Tries to convert the current custom event to a base event.
|
||||
/// </summary>
|
||||
/// <param name="value">The base event to convert to.</param>
|
||||
/// <param name="type">The type of the event.</param>
|
||||
/// <returns>True if the conversion was successful; otherwise, false.</returns>
|
||||
public virtual bool TryConvert(ref BaseEvent? value, ref EventType? type) => TryConvert(ref value, ref type, new LevelReadOrWriteSettings());
|
||||
|
||||
/// <summary>
|
||||
/// Tries to convert the current custom event to a base event with the specified settings.
|
||||
/// </summary>
|
||||
/// <param name="value">The base event to convert to.</param>
|
||||
/// <param name="type">The type of the event.</param>
|
||||
/// <param name="settings">The settings for reading or writing the level.</param>
|
||||
/// <returns>True if the conversion was successful; otherwise, false.</returns>
|
||||
public virtual bool TryConvert(ref BaseEvent? value, ref EventType? type, LevelReadOrWriteSettings settings)
|
||||
{
|
||||
JsonSerializer serializer = JsonSerializer.Create(_beat.BaseLevel?.GetSerializer(settings));
|
||||
Type eventType = Utils.EventTypeUtils.ToType(Data["type"]?.ToObject<string>() ?? "");
|
||||
bool TryConvert;
|
||||
if (eventType == null)
|
||||
{
|
||||
if (Data["target"] != null)
|
||||
value = Data.ToObject<CustomDecorationEvent>(serializer);
|
||||
else if (Data["row"] != null)
|
||||
value = Data.ToObject<CustomRowEvent>(serializer);
|
||||
else
|
||||
value = Data.ToObject<CustomEvent>(serializer);
|
||||
type = null;
|
||||
TryConvert = value is not null;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = (BaseEvent?)Data.ToObject(eventType, serializer);
|
||||
type = value?.Type;
|
||||
TryConvert = true;
|
||||
}
|
||||
return TryConvert;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data for the custom event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public JObject Data { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a custom flash event.
|
||||
/// </summary>
|
||||
public class CustomFlash : BaseEvent, IEaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomFlash"/> class.
|
||||
/// </summary>
|
||||
public CustomFlash()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
StartColor = new PaletteColor(false);
|
||||
EndColor = new PaletteColor(false);
|
||||
Type = EventType.CustomFlash;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the start color of the flash.
|
||||
/// </summary>
|
||||
public PaletteColor StartColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the background is affected.
|
||||
/// </summary>
|
||||
public bool Background { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the end color of the flash.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor EndColor { get; set; }
|
||||
/// <inheritdoc />
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the start opacity of the flash.
|
||||
/// </summary>
|
||||
public int StartOpacity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the end opacity of the flash.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public int EndOpacity { get; set; }
|
||||
/// <inheritdoc />
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override Tabs Tab { get; }
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => base.ToString() + $" {StartColor} {StartOpacity}%=>{EndColor} {EndOpacity}%";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Exceptions;
|
||||
using RhythmBase.Extensions;
|
||||
using RhythmBase.Settings;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a custom row event in the rhythm base.
|
||||
/// </summary>
|
||||
public class CustomRowEvent : BaseRowAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actual type of the event from the data.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string ActureType => Data["Type".ToLowerCamelCase()]?.ToString() ?? "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomRowEvent"/> class.
|
||||
/// </summary>
|
||||
public CustomRowEvent()
|
||||
{
|
||||
Data = [];
|
||||
Type = EventType.CustomRowEvent;
|
||||
Tab = Tabs.Rows;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CustomRowEvent"/> class with the specified data.
|
||||
/// </summary>
|
||||
/// <param name="data">The data for the event.</param>
|
||||
public CustomRowEvent(JObject data)
|
||||
{
|
||||
Type = EventType.CustomRowEvent;
|
||||
Tab = Tabs.Rows;
|
||||
Data = data;
|
||||
Beat = new RDBeat(Data["bar"]?.ToObject<uint>() ?? 1, Data["beat"]?.ToObject<float>() ?? 1f);
|
||||
Tag = Data["tag"]?.ToObject<string>() ?? "";
|
||||
Condition = Data["condition"] == null
|
||||
? null
|
||||
: Condition.Load(Data["condition"]?.ToObject<string>() ?? "");
|
||||
Active = Data["active"]?.ToObject<bool>() ?? true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => $"{Beat} *{ActureType}";
|
||||
|
||||
/// <summary>
|
||||
/// Tries to convert the current event to a base event.
|
||||
/// </summary>
|
||||
/// <param name="value">The base event to convert to.</param>
|
||||
/// <param name="type">The type of the event.</param>
|
||||
/// <returns>true if the conversion was successful; otherwise, false.</returns>
|
||||
public virtual bool TryConvert(ref BaseEvent value, ref EventType? type) => TryConvert(ref value, ref type, new LevelReadOrWriteSettings());
|
||||
|
||||
/// <summary>
|
||||
/// Tries to convert the current event to a base event with the specified settings.
|
||||
/// </summary>
|
||||
/// <param name="value">The base event to convert to.</param>
|
||||
/// <param name="type">The type of the event.</param>
|
||||
/// <param name="settings">The settings for the conversion.</param>
|
||||
/// <returns>true if the conversion was successful; otherwise, false.</returns>
|
||||
public virtual bool TryConvert(ref BaseEvent value, ref EventType? type, LevelReadOrWriteSettings settings) => TryConvert(ref value, ref type, settings);
|
||||
|
||||
/// <summary>
|
||||
/// Implicitly converts a <see cref="CustomRowEvent"/> to a <see cref="CustomEvent"/>.
|
||||
/// </summary>
|
||||
/// <param name="e">The custom row event to convert.</param>
|
||||
public static implicit operator CustomEvent(CustomRowEvent e) => new(e.Data);
|
||||
|
||||
/// <summary>
|
||||
/// Explicitly converts a <see cref="CustomEvent"/> to a <see cref="CustomRowEvent"/>.
|
||||
/// </summary>
|
||||
/// <param name="e">The custom event to convert.</param>
|
||||
/// <returns>The converted custom row event.</returns>
|
||||
/// <exception cref="RhythmBaseException">Thrown when the row field is missing from the data.</exception>
|
||||
public static explicit operator CustomRowEvent(CustomEvent e)
|
||||
{
|
||||
return e.Data["row"] != null
|
||||
? new CustomRowEvent(e.Data)
|
||||
: throw new RhythmBaseException("The row field is missing from the field contained in this object.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data for the event.
|
||||
/// </summary>
|
||||
public JObject Data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum representing default audio events in the RhythmBase application.
|
||||
/// </summary>
|
||||
public enum DefaultAudios
|
||||
{
|
||||
/// <summary>
|
||||
/// Base sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_Base,
|
||||
|
||||
/// <summary>
|
||||
/// Rest sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_Rest,
|
||||
|
||||
/// <summary>
|
||||
/// Amen fill sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_AmenFill,
|
||||
|
||||
/// <summary>
|
||||
/// First freeze sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_Freeze1,
|
||||
|
||||
/// <summary>
|
||||
/// Second freeze sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_Freeze2,
|
||||
|
||||
/// <summary>
|
||||
/// CPU freeze sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_FreezeCPU,
|
||||
|
||||
/// <summary>
|
||||
/// First burn sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_Burn1,
|
||||
|
||||
/// <summary>
|
||||
/// Second burn sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_Burn2,
|
||||
|
||||
/// <summary>
|
||||
/// CPU burn sound for the tutorial house.
|
||||
/// </summary>
|
||||
sndTutorialHouse_BurnCPU
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Rhythm Doctor event types.
|
||||
/// </summary>
|
||||
public enum EventType
|
||||
{
|
||||
/// <summary>
|
||||
/// Add a classic beat.
|
||||
/// </summary>
|
||||
AddClassicBeat,
|
||||
/// <summary>
|
||||
/// Add a free time beat.
|
||||
/// </summary>
|
||||
AddFreeTimeBeat,
|
||||
/// <summary>
|
||||
/// Add a oneshot beat.
|
||||
/// </summary>
|
||||
AddOneshotBeat,
|
||||
/// <summary>
|
||||
/// Advance the text.
|
||||
/// </summary>
|
||||
AdvanceText,
|
||||
/// <summary>
|
||||
/// Drop the bass.
|
||||
/// </summary>
|
||||
BassDrop,
|
||||
/// <summary>
|
||||
/// Call a custom method.
|
||||
/// </summary>
|
||||
CallCustomMethod,
|
||||
/// <summary>
|
||||
/// Change the players' rows.
|
||||
/// </summary>
|
||||
ChangePlayersRows,
|
||||
/// <summary>
|
||||
/// Add a comment.
|
||||
/// </summary>
|
||||
Comment,
|
||||
/// <summary>
|
||||
/// Custom decoration event, from unknown event in the level or user-defined event.
|
||||
/// </summary>
|
||||
CustomDecorationEvent,
|
||||
/// <summary>
|
||||
/// Custom event, from unknown event in the level or user-defined event.
|
||||
/// </summary>
|
||||
CustomEvent,
|
||||
/// <summary>
|
||||
/// Custom row event, from unknown event in the level or user-defined event.
|
||||
/// </summary>
|
||||
CustomRowEvent,
|
||||
/// <summary>
|
||||
/// Custom flash event.
|
||||
/// </summary>
|
||||
CustomFlash,
|
||||
/// <summary>
|
||||
/// Fade the room.
|
||||
/// </summary>
|
||||
FadeRoom,
|
||||
/// <summary>
|
||||
/// Finish the level.
|
||||
/// </summary>
|
||||
FinishLevel,
|
||||
/// <summary>
|
||||
/// Flash the screen.
|
||||
/// </summary>
|
||||
Flash,
|
||||
/// <summary>
|
||||
/// Flip the screen.
|
||||
/// </summary>
|
||||
FlipScreen,
|
||||
/// <summary>
|
||||
/// Display floating text.
|
||||
/// </summary>
|
||||
FloatingText,
|
||||
/// <summary>
|
||||
/// Hide the row.
|
||||
/// </summary>
|
||||
HideRow,
|
||||
/// <summary>
|
||||
/// Invert the colors.
|
||||
/// </summary>
|
||||
InvertColors,
|
||||
/// <summary>
|
||||
/// Mask the room.
|
||||
/// </summary>
|
||||
MaskRoom,
|
||||
/// <summary>
|
||||
/// Move an object.
|
||||
/// </summary>
|
||||
Move,
|
||||
/// <summary>
|
||||
/// Move the camera.
|
||||
/// </summary>
|
||||
MoveCamera,
|
||||
/// <summary>
|
||||
/// Move the room.
|
||||
/// </summary>
|
||||
MoveRoom,
|
||||
/// <summary>
|
||||
/// Move the row.
|
||||
/// </summary>
|
||||
MoveRow,
|
||||
/// <summary>
|
||||
/// Narrate row information.
|
||||
/// </summary>
|
||||
NarrateRowInfo,
|
||||
/// <summary>
|
||||
/// Start a new window dance.
|
||||
/// </summary>
|
||||
NewWindowDance,
|
||||
/// <summary>
|
||||
/// Paint the hands.
|
||||
/// </summary>
|
||||
PaintHands,
|
||||
/// <summary>
|
||||
/// Play an animation.
|
||||
/// </summary>
|
||||
PlayAnimation,
|
||||
/// <summary>
|
||||
/// Play an expression.
|
||||
/// </summary>
|
||||
PlayExpression,
|
||||
/// <summary>
|
||||
/// Play a song.
|
||||
/// </summary>
|
||||
PlaySong,
|
||||
/// <summary>
|
||||
/// Play a sound.
|
||||
/// </summary>
|
||||
PlaySound,
|
||||
/// <summary>
|
||||
/// Pulse the camera.
|
||||
/// </summary>
|
||||
PulseCamera,
|
||||
/// <summary>
|
||||
/// Pulse a free time beat.
|
||||
/// </summary>
|
||||
PulseFreeTimeBeat,
|
||||
/// <summary>
|
||||
/// Read the narration.
|
||||
/// </summary>
|
||||
ReadNarration,
|
||||
/// <summary>
|
||||
/// Reorder the rooms.
|
||||
/// </summary>
|
||||
ReorderRooms,
|
||||
/// <summary>
|
||||
/// Say "Ready, Get Set, Go".
|
||||
/// </summary>
|
||||
SayReadyGetSetGo,
|
||||
/// <summary>
|
||||
/// Set the background color.
|
||||
/// </summary>
|
||||
SetBackgroundColor,
|
||||
/// <summary>
|
||||
/// Set the beat sound.
|
||||
/// </summary>
|
||||
SetBeatSound,
|
||||
/// <summary>
|
||||
/// Set the beats per minute.
|
||||
/// </summary>
|
||||
SetBeatsPerMinute,
|
||||
/// <summary>
|
||||
/// Set the clap sounds.
|
||||
/// </summary>
|
||||
SetClapSounds,
|
||||
/// <summary>
|
||||
/// Set the counting sound.
|
||||
/// </summary>
|
||||
SetCountingSound,
|
||||
/// <summary>
|
||||
/// Set the crotchets per bar.
|
||||
/// </summary>
|
||||
SetCrotchetsPerBar,
|
||||
/// <summary>
|
||||
/// Set the foreground.
|
||||
/// </summary>
|
||||
SetForeground,
|
||||
/// <summary>
|
||||
/// Set the game sound.
|
||||
/// </summary>
|
||||
SetGameSound,
|
||||
/// <summary>
|
||||
/// Set the hand owner.
|
||||
/// </summary>
|
||||
SetHandOwner,
|
||||
/// <summary>
|
||||
/// Set the heart explode interval.
|
||||
/// </summary>
|
||||
SetHeartExplodeInterval,
|
||||
/// <summary>
|
||||
/// Set the heart explode volume.
|
||||
/// </summary>
|
||||
SetHeartExplodeVolume,
|
||||
/// <summary>
|
||||
/// Set the oneshot wave.
|
||||
/// </summary>
|
||||
SetOneshotWave,
|
||||
/// <summary>
|
||||
/// Set the play style.
|
||||
/// </summary>
|
||||
SetPlayStyle,
|
||||
/// <summary>
|
||||
/// Set the room content mode.
|
||||
/// </summary>
|
||||
SetRoomContentMode,
|
||||
/// <summary>
|
||||
/// Set the room perspective.
|
||||
/// </summary>
|
||||
SetRoomPerspective,
|
||||
/// <summary>
|
||||
/// Set the row X positions.
|
||||
/// </summary>
|
||||
SetRowXs,
|
||||
/// <summary>
|
||||
/// Set the speed.
|
||||
/// </summary>
|
||||
SetSpeed,
|
||||
/// <summary>
|
||||
/// Set the theme.
|
||||
/// </summary>
|
||||
SetTheme,
|
||||
/// <summary>
|
||||
/// Set the VFX preset.
|
||||
/// </summary>
|
||||
SetVFXPreset,
|
||||
/// <summary>
|
||||
/// Set the visibility.
|
||||
/// </summary>
|
||||
SetVisible,
|
||||
/// <summary>
|
||||
/// Shake the screen.
|
||||
/// </summary>
|
||||
ShakeScreen,
|
||||
/// <summary>
|
||||
/// Show the dialogue.
|
||||
/// </summary>
|
||||
ShowDialogue,
|
||||
/// <summary>
|
||||
/// Show the hands.
|
||||
/// </summary>
|
||||
ShowHands,
|
||||
/// <summary>
|
||||
/// Show the rooms.
|
||||
/// </summary>
|
||||
ShowRooms,
|
||||
/// <summary>
|
||||
/// Show the status sign.
|
||||
/// </summary>
|
||||
ShowStatusSign,
|
||||
/// <summary>
|
||||
/// Stutter effect.
|
||||
/// </summary>
|
||||
Stutter,
|
||||
/// <summary>
|
||||
/// Tag an action.
|
||||
/// </summary>
|
||||
TagAction,
|
||||
/// <summary>
|
||||
/// Text explosion effect.
|
||||
/// </summary>
|
||||
TextExplosion,
|
||||
/// <summary>
|
||||
/// Tile effect.
|
||||
/// </summary>
|
||||
Tile,
|
||||
/// <summary>
|
||||
/// Tint effect.
|
||||
/// </summary>
|
||||
Tint,
|
||||
/// <summary>
|
||||
/// Tint rows effect.
|
||||
/// </summary>
|
||||
TintRows,
|
||||
#if DEBUG
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that fades a room.
|
||||
/// </summary>
|
||||
public class FadeRoom : BaseEvent, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FadeRoom"/> class.
|
||||
/// </summary>
|
||||
public FadeRoom() { }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type for the fade effect.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the opacity level for the fade effect.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public uint Opacity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the fade effect.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; } = EventType.FadeRoom;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; } = Tabs.Rooms;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the room associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDRoom Room => new RDSingleRoom((byte)Y);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that occurs when a level is finished.
|
||||
/// </summary>
|
||||
public class FinishLevel : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FinishLevel"/> class.
|
||||
/// </summary>
|
||||
public FinishLevel()
|
||||
{
|
||||
Type = EventType.FinishLevel;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Flash event in the rhythm base.
|
||||
/// </summary>
|
||||
public class Flash : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Flash"/> class.
|
||||
/// </summary>
|
||||
public Flash()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.Flash;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the flash event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the flash event.
|
||||
/// </summary>
|
||||
public Durations Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Duration);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the possible durations for a flash event.
|
||||
/// </summary>
|
||||
public enum Durations
|
||||
{
|
||||
/// <summary>
|
||||
/// A short duration.
|
||||
/// </summary>
|
||||
Short,
|
||||
/// <summary>
|
||||
/// A medium duration.
|
||||
/// </summary>
|
||||
Medium,
|
||||
/// <summary>
|
||||
/// A long duration.
|
||||
/// </summary>
|
||||
Long
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that flips the screen in a room.
|
||||
/// </summary>
|
||||
public class FlipScreen : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FlipScreen"/> class.
|
||||
/// </summary>
|
||||
public FlipScreen()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.FlipScreen;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with this event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the screen should be flipped horizontally.
|
||||
/// </summary>
|
||||
public bool FlipX { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the screen should be flipped vertically.
|
||||
/// </summary>
|
||||
public bool FlipY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab where this event is categorized.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
string result =
|
||||
FlipX
|
||||
? FlipY
|
||||
? "X"
|
||||
: "^v"
|
||||
: FlipY
|
||||
? "<>"
|
||||
: "";
|
||||
return base.ToString() + string.Format(" {0}", result);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Converters;
|
||||
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a floating text event in a room.
|
||||
/// </summary>
|
||||
public class FloatingText : BaseEvent, IRoomEvent,IDurationEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; } = EventType.FloatingText;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; } = Tabs.Actions;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of child advance texts.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public List<AdvanceText> Children => _children;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the room associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; } = new RDRoom(true, new byte[1]);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the fade out rate of the text.
|
||||
/// </summary>
|
||||
public float FadeOutRate { get; set; }
|
||||
float IDurationEvent.Duration => FadeOutRate;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the text.
|
||||
/// </summary>
|
||||
public PaletteColor Color { get; set; } = new PaletteColor(true)
|
||||
{
|
||||
Color = RDColor.White,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the angle of the text.
|
||||
/// </summary>
|
||||
public float Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the size of the text.
|
||||
/// </summary>
|
||||
public uint Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the outline color of the text.
|
||||
/// </summary>
|
||||
public PaletteColor OutlineColor { get; set; } = new PaletteColor(true)
|
||||
{
|
||||
Color = RDColor.Black,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ID of the event.
|
||||
/// </summary>
|
||||
[JsonProperty]
|
||||
internal int Id => (int)GeneratedId;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the text.
|
||||
/// </summary>
|
||||
public RDPoint TextPosition { get; set; } = new RDPoint(new float?(50f), new float?(50f));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the anchor style of the text.
|
||||
/// </summary>
|
||||
public AnchorStyle Anchor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the anchor style of the text.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(AnchorStyleConverter))]
|
||||
[Flags]
|
||||
public enum AnchorStyle
|
||||
{
|
||||
/// <summary>
|
||||
/// The lower anchor style.
|
||||
/// </summary>
|
||||
Lower = 1,
|
||||
|
||||
/// <summary>
|
||||
/// The upper anchor style.
|
||||
/// </summary>
|
||||
Upper = 2,
|
||||
|
||||
/// <summary>
|
||||
/// The left anchor style.
|
||||
/// </summary>
|
||||
Left = 4,
|
||||
|
||||
/// <summary>
|
||||
/// The right anchor style.
|
||||
/// </summary>
|
||||
Right = 8,
|
||||
|
||||
/// <summary>
|
||||
/// The center anchor style.
|
||||
/// </summary>
|
||||
Center = 0
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mode of the text.
|
||||
/// </summary>
|
||||
public OutMode Mode { get; set; } = OutMode.FadeOut;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to show child texts.
|
||||
/// </summary>
|
||||
public bool ShowChildren { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text content.
|
||||
/// </summary>
|
||||
public string Text { get; set; } = "等呀等得好心慌……";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FloatingText"/> class.
|
||||
/// </summary>
|
||||
public FloatingText()
|
||||
{
|
||||
GeneratedId = _PrivateId;
|
||||
_PrivateId = checked((uint)(unchecked((ulong)_PrivateId) + 1UL));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + $" {Text}";
|
||||
|
||||
private static uint _PrivateId = 0U;
|
||||
|
||||
private readonly uint GeneratedId;
|
||||
|
||||
private readonly List<AdvanceText> _children = [];
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the mode of the text.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum OutMode
|
||||
{
|
||||
/// <summary>
|
||||
/// The text will fade out gradually.
|
||||
/// </summary>
|
||||
FadeOut = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The text will hide abruptly.
|
||||
/// </summary>
|
||||
HideAbruptly = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to hide a row with specific transitions and visibility options.
|
||||
/// </summary>
|
||||
public class HideRow : BaseRowAnimation
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HideRow"/> class.
|
||||
/// </summary>
|
||||
public HideRow()
|
||||
{
|
||||
Type = EventType.HideRow;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the transition type for hiding the row.
|
||||
/// </summary>
|
||||
public Transitions Transition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the visibility state of the row.
|
||||
/// </summary>
|
||||
public Shows Show { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab category of the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the possible transition types for hiding the row.
|
||||
/// </summary>
|
||||
public enum Transitions
|
||||
{
|
||||
/// <summary>
|
||||
/// Smooth transition.
|
||||
/// </summary>
|
||||
Smooth,
|
||||
/// <summary>
|
||||
/// Instant transition.
|
||||
/// </summary>
|
||||
Instant,
|
||||
/// <summary>
|
||||
/// Full transition.
|
||||
/// </summary>
|
||||
Full
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the possible visibility states of the row.
|
||||
/// </summary>
|
||||
public enum Shows
|
||||
{
|
||||
/// <summary>
|
||||
/// Row is visible.
|
||||
/// </summary>
|
||||
Visible,
|
||||
/// <summary>
|
||||
/// Row is hidden.
|
||||
/// </summary>
|
||||
Hidden,
|
||||
/// <summary>
|
||||
/// Only the character is visible.
|
||||
/// </summary>
|
||||
OnlyCharacter,
|
||||
/// <summary>
|
||||
/// Only the row is visible.
|
||||
/// </summary>
|
||||
OnlyRow
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that occurs at the beginning of a bar.
|
||||
/// </summary>
|
||||
public interface IBarBeginningEvent : IBaseEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the base interface for an event in the rhythm base system.
|
||||
/// </summary>
|
||||
public interface IBaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the event is active.
|
||||
/// </summary>
|
||||
bool Active { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the beat associated with the event.
|
||||
/// </summary>
|
||||
RDBeat Beat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the condition associated with the event.
|
||||
/// </summary>
|
||||
Condition? Condition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tag associated with the event.
|
||||
/// </summary>
|
||||
string Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Y coordinate of the event.
|
||||
/// </summary>
|
||||
int Y { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
string ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface representing a duration event.
|
||||
/// </summary>
|
||||
public interface IDurationEvent
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the ease event.
|
||||
/// </summary>
|
||||
float Duration { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface representing an ease event.
|
||||
/// </summary>
|
||||
public interface IEaseEvent:IDurationEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the type of easing.
|
||||
/// </summary>
|
||||
EaseType Ease { get; set; }
|
||||
///// <summary>
|
||||
///// Gets the default ease event.
|
||||
///// </summary>
|
||||
///// <value>
|
||||
///// The default ease event.
|
||||
///// </value>
|
||||
//static abstract IEaseEvent DefaultEvent => default;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that occurs in a room.
|
||||
/// </summary>
|
||||
public interface IRoomEvent : IBaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the room associated with the event.
|
||||
/// </summary>
|
||||
RDRoom Rooms { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that occurs within a single room.
|
||||
/// </summary>
|
||||
public interface ISingleRoomEvent : IBaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the room associated with the event.
|
||||
/// </summary>
|
||||
RDSingleRoom Room { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that inverts colors in a room.
|
||||
/// </summary>
|
||||
public class InvertColors : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InvertColors"/> class.
|
||||
/// </summary>
|
||||
public InvertColors()
|
||||
{
|
||||
Rooms = new RDRoom(false, new byte[1]);
|
||||
Type = EventType.InvertColors;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with this event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the color inversion is enabled.
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with this event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + $" {Enable}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a MaskRoom event in the RhythmBase system.
|
||||
/// </summary>
|
||||
public class MaskRoom : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MaskRoom"/> class.
|
||||
/// </summary>
|
||||
public MaskRoom()
|
||||
{
|
||||
KeyColor = new PaletteColor(false);
|
||||
Type = EventType.MaskRoom;
|
||||
Tab = Tabs.Rooms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the mask.
|
||||
/// </summary>
|
||||
public MaskTypes MaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the alpha mode.
|
||||
/// </summary>
|
||||
public AlphaModes AlphaMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the source room.
|
||||
/// </summary>
|
||||
public byte SourceRoom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of image assets.
|
||||
/// </summary>
|
||||
public List<string> Image { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the frames per second.
|
||||
/// </summary>
|
||||
public uint Fps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the key color.
|
||||
/// </summary>
|
||||
public PaletteColor KeyColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color cutoff value.
|
||||
/// </summary>
|
||||
public int ColorCutoff { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color feathering value.
|
||||
/// </summary>
|
||||
public int ColorFeathering { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the content mode.
|
||||
/// </summary>
|
||||
public ContentModes ContentMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the event type.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab type.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the room associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDRoom Room => new RDSingleRoom(checked((byte)Y));
|
||||
|
||||
/// <summary>
|
||||
/// Defines the types of masks available.
|
||||
/// </summary>
|
||||
public enum MaskTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Uses an image as the mask.
|
||||
/// </summary>
|
||||
Image,
|
||||
/// <summary>
|
||||
/// Uses a room as the mask.
|
||||
/// </summary>
|
||||
Room,
|
||||
/// <summary>
|
||||
/// Uses a color as the mask.
|
||||
/// </summary>
|
||||
Color,
|
||||
/// <summary>
|
||||
/// No mask is applied.
|
||||
/// </summary>
|
||||
None
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the alpha modes available.
|
||||
/// </summary>
|
||||
public enum AlphaModes
|
||||
{
|
||||
/// <summary>
|
||||
/// Normal alpha mode.
|
||||
/// </summary>
|
||||
Normal,
|
||||
/// <summary>
|
||||
/// Inverted alpha mode.
|
||||
/// </summary>
|
||||
Inverted
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the content modes available.
|
||||
/// </summary>
|
||||
public enum ContentModes
|
||||
{
|
||||
/// <summary>
|
||||
/// Scales the content to fill the area.
|
||||
/// </summary>
|
||||
ScaleToFill
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a move event in the rhythm base system.
|
||||
/// </summary>
|
||||
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
||||
public class Move : BaseDecorationAction, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Move"/> class.
|
||||
/// </summary>
|
||||
public Move()
|
||||
{
|
||||
Type = EventType.Move;
|
||||
Tab = Tabs.Decorations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the move event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPointE? Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the scale of the move event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDSizeE? Scale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the angle of the move event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDExpression? Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pivot point of the move event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPointE? Pivot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the move event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type of the move event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to move the camera.
|
||||
/// </summary>
|
||||
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
||||
public class MoveCamera : BaseEvent, IEaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MoveCamera"/> class.
|
||||
/// </summary>
|
||||
public MoveCamera()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.MoveCamera;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the camera position.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPointE? CameraPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the zoom level.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public int? Zoom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the angle of the camera.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDExpression? Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type of the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to move a room with easing properties.
|
||||
/// </summary>
|
||||
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
||||
public class MoveRoom : BaseEvent, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MoveRoom"/> class.
|
||||
/// </summary>
|
||||
public MoveRoom()
|
||||
{
|
||||
Type = EventType.MoveRoom;
|
||||
Tab = Tabs.Rooms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the room.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPointE? RoomPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the scale of the room.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDSizeE? Scale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the angle of the room.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDExpression? Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pivot point of the room.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPointE? Pivot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the move event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type of the move event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the room associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDRoom Rooms => new RDSingleRoom(checked((byte)Y));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to move a row with various properties such as position, scale, angle, and pivot.
|
||||
/// </summary>
|
||||
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
||||
public class MoveRow : BaseRowAnimation, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MoveRow"/> class.
|
||||
/// </summary>
|
||||
public MoveRow()
|
||||
{
|
||||
Type = EventType.MoveRow;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether a custom position is used.
|
||||
/// </summary>
|
||||
public bool CustomPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the target of the move row event.
|
||||
/// </summary>
|
||||
public Targets Target { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the row position.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPointE? RowPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the scale.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDSizeE? Scale { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the angle.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDExpression? Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pivot.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float? Pivot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the move row event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type of the move row event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab of the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the targets for the move row event.
|
||||
/// </summary>
|
||||
public enum Targets
|
||||
{
|
||||
/// <summary>
|
||||
/// Target the whole row.
|
||||
/// </summary>
|
||||
WholeRow,
|
||||
|
||||
/// <summary>
|
||||
/// Target the heart.
|
||||
/// </summary>
|
||||
Heart,
|
||||
|
||||
/// <summary>
|
||||
/// Target the character.
|
||||
/// </summary>
|
||||
Character
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Converters;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that narrates row information.
|
||||
/// </summary>
|
||||
public class NarrateRowInfo : BaseRowAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NarrateRowInfo"/> class.
|
||||
/// </summary>
|
||||
public NarrateRowInfo()
|
||||
{
|
||||
Type = EventType.NarrateRowInfo;
|
||||
Tab = Tabs.Actions;
|
||||
CustomPattern = new Patterns[6];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of narration information.
|
||||
/// </summary>
|
||||
public NarrateInfoType InfoType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the narration is sound only.
|
||||
/// </summary>
|
||||
public bool SoundOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the beats to skip during narration.
|
||||
/// </summary>
|
||||
[JsonProperty("narrateSkipBeats")]
|
||||
public NarrateSkipBeats NarrateSkipBeat { get; set; } = NarrateSkipBeats.On;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the custom pattern for the narration.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(PatternConverter))]
|
||||
public Patterns[] CustomPattern { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to skip unstable beats.
|
||||
/// </summary>
|
||||
public bool SkipsUnstable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}:{1}", InfoType, NarrateSkipBeat);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the type of narration information.
|
||||
/// </summary>
|
||||
public enum NarrateInfoType
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates a connection event.
|
||||
/// </summary>
|
||||
Connect,
|
||||
/// <summary>
|
||||
/// Indicates an update event.
|
||||
/// </summary>
|
||||
Update,
|
||||
/// <summary>
|
||||
/// Indicates a disconnection event.
|
||||
/// </summary>
|
||||
Disconnect,
|
||||
/// <summary>
|
||||
/// Indicates an online event.
|
||||
/// </summary>
|
||||
Online,
|
||||
/// <summary>
|
||||
/// Indicates an offline event.
|
||||
/// </summary>
|
||||
Offline
|
||||
}
|
||||
/// <summary>
|
||||
/// Specifies the beats to skip during narration.
|
||||
/// </summary>
|
||||
public enum NarrateSkipBeats
|
||||
{
|
||||
/// <summary>
|
||||
/// Skip beats is on.
|
||||
/// </summary>
|
||||
On,
|
||||
/// <summary>
|
||||
/// Custom skip beats.
|
||||
/// </summary>
|
||||
Custom,
|
||||
/// <summary>
|
||||
/// Skip beats is off.
|
||||
/// </summary>
|
||||
Off,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a new window dance event.
|
||||
/// </summary>
|
||||
public class NewWindowDance : BaseEvent, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NewWindowDance"/> class.
|
||||
/// </summary>
|
||||
public NewWindowDance()
|
||||
{
|
||||
Amplitude = 0f;
|
||||
Type = EventType.NewWindowDance;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the preset.
|
||||
/// </summary>
|
||||
public Presets Preset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the same preset behavior.
|
||||
/// </summary>
|
||||
public SamePresetBehaviors SamePresetBehavior { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public RDPointE Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the reference.
|
||||
/// </summary>
|
||||
public References Reference { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use a circle.
|
||||
/// </summary>
|
||||
public bool UseCircle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the speed.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float Speed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the amplitude.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float Amplitude { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the amplitude vector.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public RDPointE AmplitudeVector { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the angle.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public float? Angle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the frequency.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float Frequency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the period.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float Period { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ease type.
|
||||
/// </summary>
|
||||
public EaseTypes EaseType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the sub ease type.
|
||||
/// </summary>
|
||||
public EaseType SubEase { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration.
|
||||
/// </summary>
|
||||
[JsonProperty("easingDuration")]
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ease.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the event type.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents the presets.
|
||||
/// </summary>
|
||||
public enum Presets
|
||||
{
|
||||
/// <summary>
|
||||
/// Move preset.
|
||||
/// </summary>
|
||||
Move,
|
||||
/// <summary>
|
||||
/// Sway preset.
|
||||
/// </summary>
|
||||
Sway,
|
||||
/// <summary>
|
||||
/// Wrap preset.
|
||||
/// </summary>
|
||||
Wrap,
|
||||
/// <summary>
|
||||
/// Ellipse preset.
|
||||
/// </summary>
|
||||
Ellipse,
|
||||
/// <summary>
|
||||
/// Shake per preset.
|
||||
/// </summary>
|
||||
ShakePer
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the same preset behaviors.
|
||||
/// </summary>
|
||||
public enum SamePresetBehaviors
|
||||
{
|
||||
/// <summary>
|
||||
/// Reset behavior.
|
||||
/// </summary>
|
||||
Reset,
|
||||
/// <summary>
|
||||
/// Keep behavior.
|
||||
/// </summary>
|
||||
Keep
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the references.
|
||||
/// </summary>
|
||||
public enum References
|
||||
{
|
||||
/// <summary>
|
||||
/// Center reference.
|
||||
/// </summary>
|
||||
Center,
|
||||
/// <summary>
|
||||
/// Edge reference.
|
||||
/// </summary>
|
||||
Edge
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the ease types.
|
||||
/// </summary>
|
||||
public enum EaseTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Repeat ease type.
|
||||
/// </summary>
|
||||
Repeat,
|
||||
/// <summary>
|
||||
/// Mirror ease type.
|
||||
/// </summary>
|
||||
Mirror,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to paint hands with specified properties.
|
||||
/// </summary>
|
||||
public class PaintHands : BaseEvent, IEaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PaintHands"/> class.
|
||||
/// </summary>
|
||||
public PaintHands()
|
||||
{
|
||||
TintColor = new PaletteColor(true);
|
||||
BorderColor = new PaletteColor(true);
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.PaintHands;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tint color of the hands.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor TintColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type for the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border style of the hands.
|
||||
/// </summary>
|
||||
public Borders Border { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border color of the hands.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the opacity of the hands.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public int Opacity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the hands should be tinted.
|
||||
/// </summary>
|
||||
public bool Tint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the player hands associated with the event.
|
||||
/// </summary>
|
||||
public PlayerHands Hands { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab category of the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the border styles available for the hands.
|
||||
/// </summary>
|
||||
public enum Borders
|
||||
{
|
||||
/// <summary>
|
||||
/// No border.
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// Outline border.
|
||||
/// </summary>
|
||||
Outline,
|
||||
|
||||
/// <summary>
|
||||
/// Glow border.
|
||||
/// </summary>
|
||||
Glow
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Converters;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum representing different rhythm patterns.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(PatternConverter))]
|
||||
public enum Patterns
|
||||
{
|
||||
/// <summary>
|
||||
/// No pattern.
|
||||
/// </summary>
|
||||
None,
|
||||
/// <summary>
|
||||
/// Pattern X.
|
||||
/// </summary>
|
||||
X,
|
||||
/// <summary>
|
||||
/// Pattern Up.
|
||||
/// </summary>
|
||||
Up,
|
||||
/// <summary>
|
||||
/// Pattern Down.
|
||||
/// </summary>
|
||||
Down,
|
||||
/// <summary>
|
||||
/// Pattern Banana.
|
||||
/// </summary>
|
||||
Banana,
|
||||
/// <summary>
|
||||
/// Pattern Return.
|
||||
/// </summary>
|
||||
Return
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using Newtonsoft.Json;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an action to play an animation.
|
||||
/// </summary>
|
||||
public class PlayAnimation : BaseDecorationAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayAnimation"/> class.
|
||||
/// </summary>
|
||||
public PlayAnimation()
|
||||
{
|
||||
Type = EventType.PlayAnimation;
|
||||
Tab = Tabs.Decorations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the expression for the animation.
|
||||
/// </summary>
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||
public string Expression { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" Expression:{0}", Expression);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that plays an expression.
|
||||
/// </summary>
|
||||
public class PlayExpression : BaseRowAnimation
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayExpression"/> class.
|
||||
/// </summary>
|
||||
public PlayExpression()
|
||||
{
|
||||
Type = EventType.PlayExpression;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the expression to be played.
|
||||
/// </summary>
|
||||
public string Expression { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to replace the current expression.
|
||||
/// </summary>
|
||||
public bool Replace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab where the event is categorized.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + $" {Expression}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to play a song with specific beats per minute and other properties.
|
||||
/// </summary>
|
||||
public class PlaySong : BaseBeatsPerMinute, IBarBeginningEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlaySong"/> class.
|
||||
/// </summary>
|
||||
public PlaySong()
|
||||
{
|
||||
Type = EventType.PlaySong;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the beats per minute (BPM) for the song.
|
||||
/// </summary>
|
||||
[JsonProperty("bpm")]
|
||||
public override float BeatsPerMinute
|
||||
{
|
||||
get => base.BeatsPerMinute;
|
||||
set => base.BeatsPerMinute = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the offset time for the song.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public TimeSpan Offset
|
||||
{
|
||||
get => Song.Offset;
|
||||
set => Song.Offset = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the song should loop.
|
||||
/// </summary>
|
||||
public bool Loop { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" BPM:{0}, Song:{1}", BeatsPerMinute, Song.Filename);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the song to be played.
|
||||
/// </summary>
|
||||
public RDAudio Song = new();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to play a sound.
|
||||
/// </summary>
|
||||
public class PlaySound : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlaySound"/> class.
|
||||
/// </summary>
|
||||
public PlaySound()
|
||||
{
|
||||
Type = EventType.PlaySound;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the sound is custom.
|
||||
/// </summary>
|
||||
public bool IsCustom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the custom sound.
|
||||
/// </summary>
|
||||
public CustomSoundTypes CustomSoundType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the audio sound.
|
||||
/// </summary>
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public RDAudio? Sound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + $" {(IsCustom ? Sound?.ToString() : CustomSoundType.ToString())}";
|
||||
|
||||
/// <summary>
|
||||
/// Defines the types of custom sounds.
|
||||
/// </summary>
|
||||
public enum CustomSoundTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Cue sound type.
|
||||
/// </summary>
|
||||
CueSound,
|
||||
|
||||
/// <summary>
|
||||
/// Music sound type.
|
||||
/// </summary>
|
||||
MusicSound,
|
||||
|
||||
/// <summary>
|
||||
/// Beat sound type.
|
||||
/// </summary>
|
||||
BeatSound,
|
||||
|
||||
/// <summary>
|
||||
/// Hit sound type.
|
||||
/// </summary>
|
||||
HitSound,
|
||||
|
||||
/// <summary>
|
||||
/// Other sound type.
|
||||
/// </summary>
|
||||
OtherSound
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the hands of a player.
|
||||
/// </summary>
|
||||
public enum PlayerHands
|
||||
{
|
||||
/// <summary>
|
||||
/// The left hand of the player.
|
||||
/// </summary>
|
||||
Left,
|
||||
|
||||
/// <summary>
|
||||
/// The right hand of the player.
|
||||
/// </summary>
|
||||
Right,
|
||||
|
||||
/// <summary>
|
||||
/// Both hands of the player.
|
||||
/// </summary>
|
||||
Both,
|
||||
|
||||
/// <summary>
|
||||
/// Player 1's hand.
|
||||
/// </summary>
|
||||
p1,
|
||||
|
||||
/// <summary>
|
||||
/// Player 2's hand.
|
||||
/// </summary>
|
||||
p2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the type of player in the game.
|
||||
/// </summary>
|
||||
public enum PlayerType
|
||||
{
|
||||
/// <summary>
|
||||
/// Player 1.
|
||||
/// </summary>
|
||||
P1,
|
||||
|
||||
/// <summary>
|
||||
/// Player 2.
|
||||
/// </summary>
|
||||
P2,
|
||||
|
||||
/// <summary>
|
||||
/// Computer player.
|
||||
/// </summary>
|
||||
CPU,
|
||||
|
||||
/// <summary>
|
||||
/// No change in player type.
|
||||
/// </summary>
|
||||
NoChange
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a camera pulse event in a room.
|
||||
/// </summary>
|
||||
public class PulseCamera : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PulseCamera"/> class.
|
||||
/// </summary>
|
||||
public PulseCamera()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.PulseCamera;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the strength of the pulse.
|
||||
/// </summary>
|
||||
public byte Strength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the count of pulses.
|
||||
/// </summary>
|
||||
public int Count { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the frequency of the pulses.
|
||||
/// </summary>
|
||||
public float Frequency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a pulse free time beat event.
|
||||
/// </summary>
|
||||
public class PulseFreeTimeBeat : BaseBeat
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PulseFreeTimeBeat"/> class.
|
||||
/// </summary>
|
||||
public PulseFreeTimeBeat()
|
||||
{
|
||||
Type = EventType.PulseFreeTimeBeat;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the hold duration.
|
||||
/// </summary>
|
||||
public float Hold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the action type.
|
||||
/// </summary>
|
||||
public ActionType Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the custom pulse value.
|
||||
/// </summary>
|
||||
public uint CustomPulse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the event type.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
string Out = "";
|
||||
switch (Action)
|
||||
{
|
||||
case ActionType.Increment:
|
||||
Out = ">";
|
||||
break;
|
||||
case ActionType.Decrement:
|
||||
Out = "<";
|
||||
break;
|
||||
case ActionType.Custom:
|
||||
Out = (CustomPulse + 1).ToString();
|
||||
break;
|
||||
case ActionType.Remove:
|
||||
Out = "X";
|
||||
break;
|
||||
}
|
||||
return base.ToString() + $"{Out}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the action types for the pulse free time beat.
|
||||
/// </summary>
|
||||
public enum ActionType
|
||||
{
|
||||
/// <summary>
|
||||
/// Increment action.
|
||||
/// </summary>
|
||||
Increment,
|
||||
/// <summary>
|
||||
/// Decrement action.
|
||||
/// </summary>
|
||||
Decrement,
|
||||
/// <summary>
|
||||
/// Custom action.
|
||||
/// </summary>
|
||||
Custom,
|
||||
/// <summary>
|
||||
/// Remove action.
|
||||
/// </summary>
|
||||
Remove
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event for reading narration.
|
||||
/// </summary>
|
||||
public class ReadNarration : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReadNarration"/> class.
|
||||
/// </summary>
|
||||
public ReadNarration()
|
||||
{
|
||||
Type = EventType.ReadNarration;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text of the narration.
|
||||
/// </summary>
|
||||
public string Text { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the category of the narration.
|
||||
/// </summary>
|
||||
public NarrationCategory Category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Text);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the category of the narration.
|
||||
/// </summary>
|
||||
public enum NarrationCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// Fallback category.
|
||||
/// </summary>
|
||||
Fallback,
|
||||
/// <summary>
|
||||
/// Navigation category.
|
||||
/// </summary>
|
||||
Navigation,
|
||||
/// <summary>
|
||||
/// Instruction category.
|
||||
/// </summary>
|
||||
Instruction,
|
||||
/// <summary>
|
||||
/// Notification category.
|
||||
/// </summary>
|
||||
Notification,
|
||||
/// <summary>
|
||||
/// Dialogue category.
|
||||
/// </summary>
|
||||
Dialogue,
|
||||
/// <summary>
|
||||
/// Description category.
|
||||
/// </summary>
|
||||
Description = 6,
|
||||
/// <summary>
|
||||
/// Subtitles category.
|
||||
/// </summary>
|
||||
Subtitles
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to reorder rooms.
|
||||
/// </summary>
|
||||
public class ReorderRooms : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReorderRooms"/> class.
|
||||
/// </summary>
|
||||
public ReorderRooms()
|
||||
{
|
||||
Type = EventType.ReorderRooms;
|
||||
Tab = Tabs.Rooms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the order of the rooms.
|
||||
/// </summary>
|
||||
public List<uint> Order { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the type of row in the rhythm base.
|
||||
/// </summary>
|
||||
public enum RowType
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a classic row type.
|
||||
/// </summary>
|
||||
Classic,
|
||||
|
||||
/// <summary>
|
||||
/// Represents a oneshot row type.
|
||||
/// </summary>
|
||||
Oneshot
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
using Newtonsoft.Json;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that says "Ready, Get Set, Go" with various voice sources and phrases.
|
||||
/// </summary>
|
||||
public class SayReadyGetSetGo : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SayReadyGetSetGo"/> class.
|
||||
/// </summary>
|
||||
public SayReadyGetSetGo()
|
||||
{
|
||||
Type = EventType.SayReadyGetSetGo;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the phrase to say.
|
||||
/// </summary>
|
||||
public Words PhraseToSay { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the voice source.
|
||||
/// </summary>
|
||||
public VoiceSources VoiceSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tick value.
|
||||
/// </summary>
|
||||
public float Tick { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the volume.
|
||||
/// </summary>
|
||||
public uint Volume { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the event type.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the phrase is splitable.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool Splitable
|
||||
{
|
||||
get
|
||||
{
|
||||
return PhraseToSay == Words.SayReaDyGetSetGoNew || PhraseToSay == Words.SayGetSetGo || PhraseToSay == Words.SayReaDyGetSetOne || PhraseToSay == Words.SayGetSetOne || PhraseToSay == Words.SayReadyGetSetGo;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}: {1}", VoiceSource, PhraseToSay);
|
||||
|
||||
/// <summary>
|
||||
/// Represents the phrases that can be said.
|
||||
/// </summary>
|
||||
public enum Words
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the phrase "Ready, Get Set, Go New".
|
||||
/// </summary>
|
||||
SayReaDyGetSetGoNew,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Get Set, Go".
|
||||
/// </summary>
|
||||
SayGetSetGo,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Ready, Get Set, One".
|
||||
/// </summary>
|
||||
SayReaDyGetSetOne,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Get Set, One".
|
||||
/// </summary>
|
||||
SayGetSetOne,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Rea".
|
||||
/// </summary>
|
||||
JustSayRea,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Dy".
|
||||
/// </summary>
|
||||
JustSayDy,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Get".
|
||||
/// </summary>
|
||||
JustSayGet,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Set".
|
||||
/// </summary>
|
||||
JustSaySet,
|
||||
/// <summary>
|
||||
/// Represents the phrase "And".
|
||||
/// </summary>
|
||||
JustSayAnd,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Go".
|
||||
/// </summary>
|
||||
JustSayGo,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Stop".
|
||||
/// </summary>
|
||||
JustSayStop,
|
||||
/// <summary>
|
||||
/// Represents the phrase "And Stop".
|
||||
/// </summary>
|
||||
JustSayAndStop,
|
||||
/// <summary>
|
||||
/// Represents the count "1".
|
||||
/// </summary>
|
||||
Count1,
|
||||
/// <summary>
|
||||
/// Represents the count "2".
|
||||
/// </summary>
|
||||
Count2,
|
||||
/// <summary>
|
||||
/// Represents the count "3".
|
||||
/// </summary>
|
||||
Count3,
|
||||
/// <summary>
|
||||
/// Represents the count "4".
|
||||
/// </summary>
|
||||
Count4,
|
||||
/// <summary>
|
||||
/// Represents the count "5".
|
||||
/// </summary>
|
||||
Count5,
|
||||
/// <summary>
|
||||
/// Represents the count "6".
|
||||
/// </summary>
|
||||
Count6,
|
||||
/// <summary>
|
||||
/// Represents the count "7".
|
||||
/// </summary>
|
||||
Count7,
|
||||
/// <summary>
|
||||
/// Represents the count "8".
|
||||
/// </summary>
|
||||
Count8,
|
||||
/// <summary>
|
||||
/// Represents the count "9".
|
||||
/// </summary>
|
||||
Count9,
|
||||
/// <summary>
|
||||
/// Represents the count "10".
|
||||
/// </summary>
|
||||
Count10,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Ready, Get Set, Go".
|
||||
/// </summary>
|
||||
SayReadyGetSetGo,
|
||||
/// <summary>
|
||||
/// Represents the phrase "Ready".
|
||||
/// </summary>
|
||||
JustSayReady
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the sources of the voice.
|
||||
/// </summary>
|
||||
public enum VoiceSources
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the voice source "Nurse".
|
||||
/// </summary>
|
||||
Nurse,
|
||||
/// <summary>
|
||||
/// Represents the voice source "Nurse Tired".
|
||||
/// </summary>
|
||||
NurseTired,
|
||||
/// <summary>
|
||||
/// Represents the voice source "Nurse Swing".
|
||||
/// </summary>
|
||||
NurseSwing,
|
||||
/// <summary>
|
||||
/// Represents the voice source "Nurse Swing Calm".
|
||||
/// </summary>
|
||||
NurseSwingCalm,
|
||||
/// <summary>
|
||||
/// Represents the voice source "Ian Excited".
|
||||
/// </summary>
|
||||
IanExcited,
|
||||
/// <summary>
|
||||
/// Represents the voice source "Ian Calm".
|
||||
/// </summary>
|
||||
IanCalm,
|
||||
/// <summary>
|
||||
/// Represents the voice source "Ian Slow".
|
||||
/// </summary>
|
||||
IanSlow,
|
||||
/// <summary>
|
||||
/// Represents the voice source "None Bottom".
|
||||
/// </summary>
|
||||
NoneBottom,
|
||||
/// <summary>
|
||||
/// Represents the voice source "None Top".
|
||||
/// </summary>
|
||||
NoneTop
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the background color.
|
||||
/// </summary>
|
||||
public class SetBackgroundColor : BaseEvent, IEaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetBackgroundColor"/> class.
|
||||
/// </summary>
|
||||
public SetBackgroundColor()
|
||||
{
|
||||
Rooms = new RDRoom(false, new byte[1]);
|
||||
Color = new PaletteColor(true);
|
||||
Type = EventType.SetBackgroundColor;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type for the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the content mode for the event.
|
||||
/// </summary>
|
||||
public ContentModes ContentMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the filter mode for the event.
|
||||
/// </summary>
|
||||
public FilterModes Filter { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color for the background.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interval for the event.
|
||||
/// </summary>
|
||||
public float Interval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the background type for the event.
|
||||
/// </summary>
|
||||
public BackgroundTypes BackgroundType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the frames per second for the event.
|
||||
/// </summary>
|
||||
public int Fps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of images for the background.
|
||||
/// </summary>
|
||||
public List<string> Image { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the horizontal scroll value.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public int ScrollX { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the vertical scroll value.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public int ScrollY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tiling type for the background.
|
||||
/// </summary>
|
||||
public TilingTypes TilingType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the event type.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => BackgroundType == BackgroundTypes.Color
|
||||
? base.ToString() + $" {Color}"
|
||||
: base.ToString() + $" {string.Join(',', Image)}";
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the types of backgrounds.
|
||||
/// </summary>
|
||||
public enum BackgroundTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Background is a color.
|
||||
/// </summary>
|
||||
Color,
|
||||
|
||||
/// <summary>
|
||||
/// Background is an image.
|
||||
/// </summary>
|
||||
Image
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the filter modes.
|
||||
/// </summary>
|
||||
public enum FilterModes
|
||||
{
|
||||
/// <summary>
|
||||
/// Nearest neighbor filtering.
|
||||
/// </summary>
|
||||
NearestNeighbor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an action to set the beat sound in the rhythm base.
|
||||
/// </summary>
|
||||
public class SetBeatSound : BaseRowAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetBeatSound"/> class.
|
||||
/// </summary>
|
||||
public SetBeatSound()
|
||||
{
|
||||
Sound = new RDAudio();
|
||||
Type = EventType.SetBeatSound;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the audio sound for the beat.
|
||||
/// </summary>
|
||||
public RDAudio Sound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the beats per minute (BPM) in the rhythm base.
|
||||
/// </summary>
|
||||
public class SetBeatsPerMinute : BaseBeatsPerMinute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetBeatsPerMinute"/> class.
|
||||
/// </summary>
|
||||
public SetBeatsPerMinute()
|
||||
{
|
||||
Type = EventType.SetBeatsPerMinute;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString() => base.ToString() + $" BPM:{BeatsPerMinute}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set clap sounds for different players and CPU.
|
||||
/// </summary>
|
||||
public class SetClapSounds : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetClapSounds"/> class.
|
||||
/// </summary>
|
||||
public SetClapSounds()
|
||||
{
|
||||
Type = EventType.SetClapSounds;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the clap sound for player 1.
|
||||
/// </summary>
|
||||
public RDAudio? P1Sound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the clap sound for player 2.
|
||||
/// </summary>
|
||||
public RDAudio? P2Sound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the clap sound for the CPU.
|
||||
/// </summary>
|
||||
public RDAudio? CpuSound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the row type for the event.
|
||||
/// </summary>
|
||||
public RowType RowType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an action to set the counting sound in the rhythm base.
|
||||
/// </summary>
|
||||
public class SetCountingSound : BaseRowAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetCountingSound"/> class.
|
||||
/// </summary>
|
||||
public SetCountingSound()
|
||||
{
|
||||
Volume = 100;
|
||||
Sounds = new RDAudio[7];
|
||||
Type = EventType.SetCountingSound;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the voice source for the counting sound.
|
||||
/// </summary>
|
||||
public VoiceSources VoiceSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="SetCountingSound"/> is enabled.
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the subdivision offset for the counting sound.
|
||||
/// </summary>
|
||||
public float SubdivOffset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the volume of the counting sound.
|
||||
/// </summary>
|
||||
public int Volume { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of sounds for the counting sound.
|
||||
/// </summary>
|
||||
public RDAudio[] Sounds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents the different voice sources for the counting sound.
|
||||
/// </summary>
|
||||
public enum VoiceSources
|
||||
{
|
||||
/// <summary>
|
||||
/// Jyi Count
|
||||
/// </summary>
|
||||
JyiCount,
|
||||
/// <summary>
|
||||
/// Jyi Count Fast
|
||||
/// </summary>
|
||||
JyiCountFast,
|
||||
/// <summary>
|
||||
/// Jyi Count Calm
|
||||
/// </summary>
|
||||
JyiCountCalm,
|
||||
/// <summary>
|
||||
/// Jyi Count Tired
|
||||
/// </summary>
|
||||
JyiCountTired,
|
||||
/// <summary>
|
||||
/// Jyi Count Very Tired
|
||||
/// </summary>
|
||||
JyiCountVeryTired,
|
||||
/// <summary>
|
||||
/// Jyi Count Japanese
|
||||
/// </summary>
|
||||
JyiCountJapanese,
|
||||
/// <summary>
|
||||
/// Ian Count
|
||||
/// </summary>
|
||||
IanCount,
|
||||
/// <summary>
|
||||
/// Ian Count Fast
|
||||
/// </summary>
|
||||
IanCountFast,
|
||||
/// <summary>
|
||||
/// Ian Count Calm
|
||||
/// </summary>
|
||||
IanCountCalm,
|
||||
/// <summary>
|
||||
/// Ian Count Slow
|
||||
/// </summary>
|
||||
IanCountSlow,
|
||||
/// <summary>
|
||||
/// Ian Count Slower
|
||||
/// </summary>
|
||||
IanCountSlower,
|
||||
/// <summary>
|
||||
/// Whistle Count
|
||||
/// </summary>
|
||||
WhistleCount,
|
||||
/// <summary>
|
||||
/// Bird Count
|
||||
/// </summary>
|
||||
BirdCount,
|
||||
/// <summary>
|
||||
/// Parrot Count
|
||||
/// </summary>
|
||||
ParrotCount,
|
||||
/// <summary>
|
||||
/// Owl Count
|
||||
/// </summary>
|
||||
OwlCount,
|
||||
/// <summary>
|
||||
/// Oriole Count
|
||||
/// </summary>
|
||||
OrioleCount,
|
||||
/// <summary>
|
||||
/// Wren Count
|
||||
/// </summary>
|
||||
WrenCount,
|
||||
/// <summary>
|
||||
/// Canary Count
|
||||
/// </summary>
|
||||
CanaryCount,
|
||||
/// <summary>
|
||||
/// Jyi Count Legacy
|
||||
/// </summary>
|
||||
JyiCountLegacy,
|
||||
/// <summary>
|
||||
/// Jyi Count English
|
||||
/// </summary>
|
||||
JyiCountEnglish,
|
||||
/// <summary>
|
||||
/// Ian Count English
|
||||
/// </summary>
|
||||
IanCountEnglish,
|
||||
/// <summary>
|
||||
/// Ian Count English Calm
|
||||
/// </summary>
|
||||
IanCountEnglishCalm,
|
||||
/// <summary>
|
||||
/// Ian Count English Slow
|
||||
/// </summary>
|
||||
IanCountEnglishSlow,
|
||||
/// <summary>
|
||||
/// Custom
|
||||
/// </summary>
|
||||
Custom
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the number of crotchets per bar.
|
||||
/// </summary>
|
||||
public class SetCrotchetsPerBar : BaseEvent, IBarBeginningEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetCrotchetsPerBar"/> class.
|
||||
/// </summary>
|
||||
public SetCrotchetsPerBar()
|
||||
{
|
||||
_crotchetsPerBar = 7U;
|
||||
Type = EventType.SetCrotchetsPerBar;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the visual beat multiplier.
|
||||
/// </summary>
|
||||
/// <exception cref="OverflowException">Thrown when the value is less than 1.</exception>
|
||||
public float VisualBeatMultiplier { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of crotchets per bar.
|
||||
/// </summary>
|
||||
public uint CrotchetsPerBar
|
||||
{
|
||||
get => (uint)(_crotchetsPerBar + 1);
|
||||
set
|
||||
{
|
||||
_crotchetsPerBar = checked((uint)(unchecked((ulong)value) - 1UL));
|
||||
if (_beat._calculator != null)
|
||||
{
|
||||
Beat += 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + $" CPB:{_crotchetsPerBar + 1}";
|
||||
|
||||
/// <summary>
|
||||
/// The number of crotchets per bar.
|
||||
/// </summary>
|
||||
protected internal uint _crotchetsPerBar;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the foreground in a room.
|
||||
/// </summary>
|
||||
public class SetForeground : BaseEvent, IEaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetForeground"/> class.
|
||||
/// </summary>
|
||||
public SetForeground()
|
||||
{
|
||||
Rooms = new RDRoom(false, new byte[1]);
|
||||
Color = new PaletteColor(true);
|
||||
Type = EventType.SetForeground;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the content mode for the event.
|
||||
/// </summary>
|
||||
public ContentModes ContentMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tiling type for the event.
|
||||
/// </summary>
|
||||
public TilingTypes TilingType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color for the foreground.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of images for the foreground.
|
||||
/// </summary>
|
||||
public List<string> Image { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the frames per second for the foreground animation.
|
||||
/// </summary>
|
||||
public float Fps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the horizontal scroll value.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float ScrollX { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the vertical scroll value.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float ScrollY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interval between frames.
|
||||
/// </summary>
|
||||
public float Interval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type for the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + $" {Color},{string.Join(',', Image.Select(i => i.ToString()))}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Converters;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the game sound.
|
||||
/// </summary>
|
||||
public partial class SetGameSound : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetGameSound"/> class.
|
||||
/// </summary>
|
||||
public SetGameSound()
|
||||
{
|
||||
Audio = new RDAudio();
|
||||
Type = EventType.SetGameSound;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the audio associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
private RDAudio Audio { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the sound.
|
||||
/// </summary>
|
||||
public SoundTypes SoundType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the filename of the audio.
|
||||
/// </summary>
|
||||
public string Filename
|
||||
{
|
||||
get => Audio.Filename;
|
||||
set => Audio.Filename = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the volume of the audio.
|
||||
/// </summary>
|
||||
public int Volume
|
||||
{
|
||||
get => Audio.Volume;
|
||||
set => Audio.Volume = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pitch of the audio.
|
||||
/// </summary>
|
||||
public int Pitch
|
||||
{
|
||||
get => Audio.Pitch;
|
||||
set => Audio.Pitch = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pan of the audio.
|
||||
/// </summary>
|
||||
public int Pan
|
||||
{
|
||||
get => Audio.Pan;
|
||||
set => Audio.Pan = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the offset time of the audio.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(MilliSecondConverter))]
|
||||
public TimeSpan Offset
|
||||
{
|
||||
get => Audio.Offset;
|
||||
set => Audio.Offset = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of sound subtypes.
|
||||
/// </summary>
|
||||
public List<SoundSubType> SoundSubtypes { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", SoundType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the owner of a hand in a room.
|
||||
/// </summary>
|
||||
public class SetHandOwner : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetHandOwner"/> class.
|
||||
/// </summary>
|
||||
public SetHandOwner()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.SetHandOwner;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the room associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the hand associated with the event.
|
||||
/// </summary>
|
||||
public PlayerHands Hand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the character associated with the event.
|
||||
/// </summary>
|
||||
public RDCharacters Character { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the heart explode interval.
|
||||
/// </summary>
|
||||
public class SetHeartExplodeInterval : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetHeartExplodeInterval"/> class.
|
||||
/// </summary>
|
||||
public SetHeartExplodeInterval()
|
||||
{
|
||||
Type = EventType.SetHeartExplodeInterval;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of interval.
|
||||
/// </summary>
|
||||
public IntervalTypes IntervalType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interval value.
|
||||
/// </summary>
|
||||
public int Interval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the types of intervals.
|
||||
/// </summary>
|
||||
public enum IntervalTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Interval of one beat after.
|
||||
/// </summary>
|
||||
OneBeatAfter,
|
||||
|
||||
/// <summary>
|
||||
/// Instant interval.
|
||||
/// </summary>
|
||||
Instant,
|
||||
|
||||
/// <summary>
|
||||
/// Gather without ceiling.
|
||||
/// </summary>
|
||||
GatherNoCeil,
|
||||
|
||||
/// <summary>
|
||||
/// Gather and ceiling.
|
||||
/// </summary>
|
||||
GatherAndCeil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the volume of the heart explosion sound.
|
||||
/// </summary>
|
||||
public class SetHeartExplodeVolume : BaseEvent, IBarBeginningEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetHeartExplodeVolume"/> class.
|
||||
/// </summary>
|
||||
public SetHeartExplodeVolume()
|
||||
{
|
||||
Type = EventType.SetHeartExplodeVolume;
|
||||
Tab = Tabs.Sounds;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the volume of the heart explosion sound.
|
||||
/// </summary>
|
||||
public uint Volume { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set a one-shot wave.
|
||||
/// </summary>
|
||||
public class SetOneshotWave : BaseBeat
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetOneshotWave"/> class.
|
||||
/// </summary>
|
||||
public SetOneshotWave()
|
||||
{
|
||||
Type = EventType.SetOneshotWave;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of wave.
|
||||
/// </summary>
|
||||
public Waves WaveType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the height of the wave.
|
||||
/// </summary>
|
||||
public int Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the width of the wave.
|
||||
/// </summary>
|
||||
public int Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the types of waves.
|
||||
/// </summary>
|
||||
public enum Waves
|
||||
{
|
||||
/// <summary>
|
||||
/// Boom and rush wave.
|
||||
/// </summary>
|
||||
BoomAndRush,
|
||||
|
||||
/// <summary>
|
||||
/// Ball wave.
|
||||
/// </summary>
|
||||
Ball,
|
||||
|
||||
/// <summary>
|
||||
/// Spring wave.
|
||||
/// </summary>
|
||||
Spring,
|
||||
|
||||
/// <summary>
|
||||
/// Spike wave.
|
||||
/// </summary>
|
||||
Spike,
|
||||
|
||||
/// <summary>
|
||||
/// Huge spike wave.
|
||||
/// </summary>
|
||||
SpikeHuge,
|
||||
|
||||
/// <summary>
|
||||
/// Single wave.
|
||||
/// </summary>
|
||||
Single
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the play style.
|
||||
/// </summary>
|
||||
public class SetPlayStyle : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetPlayStyle"/> class.
|
||||
/// </summary>
|
||||
public SetPlayStyle()
|
||||
{
|
||||
Type = EventType.SetPlayStyle;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the play style.
|
||||
/// </summary>
|
||||
[JsonProperty(nameof(PlayStyle))]
|
||||
public PlayStyles PlayStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the next bar.
|
||||
/// </summary>
|
||||
[JsonProperty(nameof(NextBar))]
|
||||
public int NextBar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the play style is relative.
|
||||
/// </summary>
|
||||
[JsonProperty(nameof(Relative))]
|
||||
public bool Relative { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the play styles.
|
||||
/// </summary>
|
||||
public enum PlayStyles
|
||||
{
|
||||
/// <summary>
|
||||
/// Normal play style.
|
||||
/// </summary>
|
||||
Normal,
|
||||
|
||||
/// <summary>
|
||||
/// Loop play style.
|
||||
/// </summary>
|
||||
Loop,
|
||||
|
||||
/// <summary>
|
||||
/// Prolong play style.
|
||||
/// </summary>
|
||||
Prolong,
|
||||
|
||||
/// <summary>
|
||||
/// Immediate play style.
|
||||
/// </summary>
|
||||
Immediately,
|
||||
|
||||
/// <summary>
|
||||
/// Extra immediate play style.
|
||||
/// </summary>
|
||||
ExtraImmediately,
|
||||
|
||||
/// <summary>
|
||||
/// Prolong one bar play style.
|
||||
/// </summary>
|
||||
ProlongOneBar
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the room content mode.
|
||||
/// </summary>
|
||||
public class SetRoomContentMode : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetRoomContentMode"/> class.
|
||||
/// </summary>
|
||||
public SetRoomContentMode()
|
||||
{
|
||||
Type = EventType.SetRoomContentMode;
|
||||
Tab = Tabs.Rooms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mode of the room content.
|
||||
/// </summary>
|
||||
public Modes Mode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the room associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDRoom Room
|
||||
{
|
||||
get
|
||||
{
|
||||
return new RDSingleRoom(checked((byte)Y));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the modes for room content.
|
||||
/// </summary>
|
||||
public enum Modes
|
||||
{
|
||||
#pragma warning disable CS1591
|
||||
Center,
|
||||
ScaleToFill,
|
||||
AspectFit,
|
||||
AspectFill,
|
||||
Tiled,
|
||||
Real
|
||||
#pragma warning restore CS1591
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set the room perspective.
|
||||
/// </summary>
|
||||
public class SetRoomPerspective : BaseEvent, IEaseEvent
|
||||
{
|
||||
private RDPointE?[] cornerPositions= [
|
||||
new(0,0),
|
||||
new(100,0),
|
||||
new(0,100),
|
||||
new(100,100),
|
||||
];
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetRoomPerspective"/> class.
|
||||
/// </summary>
|
||||
public SetRoomPerspective()
|
||||
{
|
||||
Type = EventType.SetRoomPerspective;
|
||||
Tab = Tabs.Rooms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the corner positions of the room.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPointE?[] CornerPositions { get => cornerPositions; set => cornerPositions = value.Length == 4?value:throw new RhythmBase.Exceptions.RhythmBaseException(); }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ease type of the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the room associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDRoom Room => new RDSingleRoom(checked((byte)Y));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Converters;
|
||||
using RhythmBase.Extensions;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class SetRowXs : BaseBeat
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public SetRowXs() { }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override EventType Type => EventType.SetRowXs;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pattern.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(PatternConverter))]
|
||||
public Patterns[] Pattern
|
||||
{
|
||||
get => _pattern;
|
||||
set => _pattern = value.Length == 6 ? value : throw new RhythmBase.Exceptions.RhythmBaseException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the synco beat.
|
||||
/// </summary>
|
||||
public sbyte SyncoBeat { get; set; } = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the synco swing.
|
||||
/// </summary>
|
||||
public float SyncoSwing { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to play the modifier sound.
|
||||
/// </summary>
|
||||
public bool SyncoPlayModifierSound { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the synco volume.
|
||||
/// </summary>
|
||||
public int SyncoVolume { get; set; } = 100;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", this.GetPatternString());
|
||||
|
||||
private Patterns[] _pattern = new Patterns[6];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that sets the speed in the rhythm base.
|
||||
/// </summary>
|
||||
public class SetSpeed : BaseEvent, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetSpeed"/> class.
|
||||
/// </summary>
|
||||
public SetSpeed()
|
||||
{
|
||||
Type = EventType.SetSpeed;
|
||||
Rooms = RDRoom.Default();
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of easing for the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the speed for the event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float Speed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" Speed:{0}", Speed);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set a theme in a room.
|
||||
/// </summary>
|
||||
public class SetTheme : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetTheme"/> class.
|
||||
/// </summary>
|
||||
public SetTheme()
|
||||
{
|
||||
Preset = Theme.None;
|
||||
Type = EventType.SetTheme;
|
||||
Tab = Tabs.Actions;
|
||||
Rooms = new RDRoom(false, new byte[1]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the theme preset.
|
||||
/// </summary>
|
||||
public Theme Preset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the variant of the theme.
|
||||
/// </summary>
|
||||
public byte Variant { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to skip paint effects.
|
||||
/// </summary>
|
||||
public bool SkipPaintEffects { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Preset);
|
||||
|
||||
/// <summary>
|
||||
/// Represents the available themes.
|
||||
/// </summary>
|
||||
public enum Theme
|
||||
{
|
||||
#pragma warning disable CS1591
|
||||
None,
|
||||
Intimate,
|
||||
IntimateSimple,
|
||||
InsomniacDay,
|
||||
InsomniacNight,
|
||||
Matrix,
|
||||
NeonMuseum,
|
||||
CrossesStraight,
|
||||
CrossesFalling,
|
||||
CubesFalling,
|
||||
CubesFallingNiceBlue,
|
||||
OrientalTechno,
|
||||
Kaleidoscope,
|
||||
PoliticiansRally,
|
||||
Rooftop,
|
||||
RooftopSummer,
|
||||
RooftopAutumn,
|
||||
BackAlley,
|
||||
Sky,
|
||||
NightSky,
|
||||
HallOfMirrors,
|
||||
CoffeeShop,
|
||||
CoffeeShopNight,
|
||||
Garden,
|
||||
GardenNight,
|
||||
TrainDay,
|
||||
TrainNight,
|
||||
DesertDay,
|
||||
DesertNight,
|
||||
HospitalWard,
|
||||
HospitalWardNight,
|
||||
PaigeOffice,
|
||||
Basement,
|
||||
ColeWardNight,
|
||||
ColeWardSunrise,
|
||||
BoyWard,
|
||||
GirlWard,
|
||||
Skyline,
|
||||
SkylineBlue,
|
||||
FloatingHeart,
|
||||
FloatingHeartWithCubes,
|
||||
FloatingHeartBroken,
|
||||
FloatingHeartBrokenWithCubes,
|
||||
ZenGarden,
|
||||
Space,
|
||||
Vaporwave,
|
||||
RollerDisco,
|
||||
Stadium,
|
||||
StadiumStormy,
|
||||
AthleteWard,
|
||||
AthleteWardNight,
|
||||
ProceduralTree
|
||||
#pragma warning restore CS1591
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to set a VFX preset.
|
||||
/// </summary>
|
||||
public class SetVFXPreset : BaseEvent, IEaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetVFXPreset"/> class.
|
||||
/// </summary>
|
||||
public SetVFXPreset()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Color = new PaletteColor(false);
|
||||
Type = EventType.SetVFXPreset;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the VFX preset.
|
||||
/// </summary>
|
||||
public Presets Preset { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the VFX is enabled.
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the threshold value for the VFX.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float Threshold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the intensity of the VFX.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float Intensity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the VFX.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
|
||||
public PaletteColor Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the X coordinate for the VFX.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float FloatX { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Y coordinate for the VFX.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public float FloatY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type for the VFX.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the VFX.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => $"{base.ToString()} {Preset}";
|
||||
|
||||
/// <summary>
|
||||
/// Enum representing various VFX presets.
|
||||
/// </summary>
|
||||
public enum Presets
|
||||
{
|
||||
#pragma warning disable CS1591
|
||||
SilhouettesOnHBeat,
|
||||
Vignette,
|
||||
VignetteFlicker,
|
||||
ColourfulShockwaves,
|
||||
BassDropOnHit,
|
||||
ShakeOnHeartBeat,
|
||||
ShakeOnHit,
|
||||
WavyRows,
|
||||
LightStripVert,
|
||||
VHS,
|
||||
CutsceneMode,
|
||||
HueShift,
|
||||
Brightness,
|
||||
Contrast,
|
||||
Saturation,
|
||||
Noise,
|
||||
GlitchObstruction,
|
||||
Rain,
|
||||
Matrix,
|
||||
Confetti,
|
||||
FallingPetals,
|
||||
FallingPetalsInstant,
|
||||
FallingPetalsSnow,
|
||||
Snow,
|
||||
Bloom,
|
||||
OrangeBloom,
|
||||
BlueBloom,
|
||||
HallOfMirrors,
|
||||
TileN,
|
||||
Sepia,
|
||||
CustomScreenScroll,
|
||||
JPEG,
|
||||
NumbersAbovePulses,
|
||||
Mosaic,
|
||||
ScreenWaves,
|
||||
Funk,
|
||||
Grain,
|
||||
Blizzard,
|
||||
Drawing,
|
||||
Aberration,
|
||||
Blur,
|
||||
RadialBlur,
|
||||
Dots,
|
||||
DisableAll,
|
||||
Diamonds,
|
||||
Tutorial,
|
||||
Balloons,
|
||||
|
||||
BlackAndWhite,
|
||||
Blackout,
|
||||
ScreenScrollX,
|
||||
ScreenScroll,
|
||||
ScreenScrollXSansVHS,
|
||||
ScreenScrollSansVHS,
|
||||
RowGlowWhite,
|
||||
RowAllWhite,
|
||||
RowOutline,
|
||||
RowShadow,
|
||||
RowSilhouetteGlow,
|
||||
RowPlain,
|
||||
Tile2,
|
||||
Tile3,
|
||||
Tile4
|
||||
#pragma warning restore CS1591
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an action to set the visibility of a decoration.
|
||||
/// </summary>
|
||||
public class SetVisible : BaseDecorationAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SetVisible"/> class.
|
||||
/// </summary>
|
||||
public SetVisible()
|
||||
{
|
||||
Type = EventType.SetVisible;
|
||||
Tab = Tabs.Decorations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab to which the event belongs.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the decoration is visible.
|
||||
/// </summary>
|
||||
public bool Visible { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Visible);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that shakes the screen.
|
||||
/// </summary>
|
||||
public class ShakeScreen : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShakeScreen"/> class.
|
||||
/// </summary>
|
||||
public ShakeScreen()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.ShakeScreen;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the shake level of the event.
|
||||
/// </summary>
|
||||
public ShakeLevels ShakeLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", ShakeLevel);
|
||||
|
||||
/// <summary>
|
||||
/// Defines the levels of screen shake.
|
||||
/// </summary>
|
||||
public enum ShakeLevels
|
||||
{
|
||||
/// <summary>
|
||||
/// Low level of screen shake.
|
||||
/// </summary>
|
||||
Low,
|
||||
/// <summary>
|
||||
/// Medium level of screen shake.
|
||||
/// </summary>
|
||||
Medium,
|
||||
/// <summary>
|
||||
/// High level of screen shake.
|
||||
/// </summary>
|
||||
High
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components.RichText;
|
||||
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to show a dialogue in the game.
|
||||
/// </summary>
|
||||
public class ShowDialogue : BaseEvent
|
||||
{
|
||||
private RDDialogueExchange dialogueList = [];
|
||||
private string text = "";
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShowDialogue"/> class.
|
||||
/// </summary>
|
||||
public ShowDialogue()
|
||||
{
|
||||
Speed = 1;
|
||||
Type = EventType.ShowDialogue;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text of the dialogue.
|
||||
/// </summary>
|
||||
public string Text
|
||||
{
|
||||
get => text; set
|
||||
{
|
||||
text = value;
|
||||
dialogueList = RDDialogueExchange.Deserialize(value);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the dialogue list. When set, the Text property is updated with the serialized value of the dialogue list.
|
||||
/// </summary>
|
||||
/// <value>The dialogue list.</value>
|
||||
[JsonIgnore]
|
||||
public RDDialogueExchange DialogueList
|
||||
{
|
||||
get => dialogueList; set
|
||||
{
|
||||
dialogueList = value;
|
||||
text = dialogueList.Serialize();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the side of the panel where the dialogue will be shown.
|
||||
/// </summary>
|
||||
public Sides PanelSide { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the side of the portrait in the dialogue.
|
||||
/// </summary>
|
||||
public PortraitSides PortraitSide { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the speed of the dialogue display.
|
||||
/// </summary>
|
||||
public int Speed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether text sounds should be played.
|
||||
/// </summary>
|
||||
public bool PlayTextSounds { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab where the event is categorized.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Text);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the sides where the dialogue panel can be shown.
|
||||
/// </summary>
|
||||
public enum Sides
|
||||
{
|
||||
/// <summary>
|
||||
/// The bottom side.
|
||||
/// </summary>
|
||||
Bottom,
|
||||
/// <summary>
|
||||
/// The top side.
|
||||
/// </summary>
|
||||
Top
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the sides where the portrait can be shown.
|
||||
/// </summary>
|
||||
public enum PortraitSides
|
||||
{
|
||||
/// <summary>
|
||||
/// The left side.
|
||||
/// </summary>
|
||||
Left,
|
||||
/// <summary>
|
||||
/// The right side.
|
||||
/// </summary>
|
||||
Right
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to show hands in a room.
|
||||
/// </summary>
|
||||
public class ShowHands : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShowHands"/> class.
|
||||
/// </summary>
|
||||
public ShowHands()
|
||||
{
|
||||
Rooms = new RDRoom(true, new byte[1]);
|
||||
Type = EventType.ShowHands;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the action to be performed.
|
||||
/// </summary>
|
||||
public Actions Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the hand of the player.
|
||||
/// </summary>
|
||||
public PlayerHands Hand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the hands should be aligned.
|
||||
/// </summary>
|
||||
public bool Align { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the action should be instant.
|
||||
/// </summary>
|
||||
public bool Instant { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the extent of the action.
|
||||
/// </summary>
|
||||
public Extents Extent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the possible actions for the event.
|
||||
/// </summary>
|
||||
public enum Actions
|
||||
{
|
||||
/// <summary>
|
||||
/// Show the hands.
|
||||
/// </summary>
|
||||
Show,
|
||||
|
||||
/// <summary>
|
||||
/// Hide the hands.
|
||||
/// </summary>
|
||||
Hide,
|
||||
|
||||
/// <summary>
|
||||
/// Raise the hands.
|
||||
/// </summary>
|
||||
Raise,
|
||||
|
||||
/// <summary>
|
||||
/// Lower the hands.
|
||||
/// </summary>
|
||||
Lower
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the possible extents for the action.
|
||||
/// </summary>
|
||||
public enum Extents
|
||||
{
|
||||
/// <summary>
|
||||
/// Full extent.
|
||||
/// </summary>
|
||||
Full,
|
||||
|
||||
/// <summary>
|
||||
/// Short extent.
|
||||
/// </summary>
|
||||
Short
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to show rooms.
|
||||
/// </summary>
|
||||
public class ShowRooms : BaseEvent, IEaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShowRooms"/> class.
|
||||
/// </summary>
|
||||
public ShowRooms()
|
||||
{
|
||||
Rooms = new RDRoom(false, new byte[1]);
|
||||
Heights = new List<int>(4);
|
||||
Type = EventType.ShowRooms;
|
||||
Tab = Tabs.Rooms;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the event.
|
||||
/// </summary>
|
||||
[JsonProperty]
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ease type for the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the heights associated with the event.
|
||||
/// </summary>
|
||||
public List<int> Heights { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the transition.
|
||||
/// </summary>
|
||||
[JsonProperty("transitionTime")]
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using Newtonsoft.Json;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event to show a status sign.
|
||||
/// </summary>
|
||||
public class ShowStatusSign : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ShowStatusSign"/> class.
|
||||
/// </summary>
|
||||
public ShowStatusSign()
|
||||
{
|
||||
UseBeats = true;
|
||||
Narrate = true;
|
||||
Type = EventType.ShowStatusSign;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use beats.
|
||||
/// </summary>
|
||||
public bool UseBeats { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to narrate.
|
||||
/// </summary>
|
||||
public bool Narrate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text to display.
|
||||
/// </summary>
|
||||
public string Text { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the status sign in seconds.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the status sign as a <see cref="TimeSpan"/>.
|
||||
/// </summary>
|
||||
[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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab of the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Text);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a stutter event in a room.
|
||||
/// </summary>
|
||||
public class Stutter : BaseEvent, IRoomEvent
|
||||
{
|
||||
private float sourceBeat = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Stutter"/> class.
|
||||
/// </summary>
|
||||
public Stutter()
|
||||
{
|
||||
Rooms = new RDRoom(false, new byte[1]);
|
||||
Type = EventType.Stutter;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the room associated with the stutter event.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the source beat of the stutter event.
|
||||
/// </summary>
|
||||
public float SourceBeat
|
||||
{
|
||||
get => sourceBeat;
|
||||
set => sourceBeat = (value > 1 && value <= Beat.CPB + 1) ? value : throw new Exceptions.RhythmBaseException("SourceBeat must in CPB.");
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or sets the length of the stutter event.
|
||||
/// </summary>
|
||||
public float Length { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the action of the stutter event.
|
||||
/// </summary>
|
||||
public Actions Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of loops for the stutter event.
|
||||
/// </summary>
|
||||
public int Loops { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the possible actions for the stutter event.
|
||||
/// </summary>
|
||||
public enum Actions
|
||||
{
|
||||
/// <summary>
|
||||
/// Add action.
|
||||
/// </summary>
|
||||
Add,
|
||||
|
||||
/// <summary>
|
||||
/// Cancel action.
|
||||
/// </summary>
|
||||
Cancel
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Converters;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the different tabs available in the RhythmBase application.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(TabsConverter))]
|
||||
public enum Tabs
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the Sounds tab.
|
||||
/// </summary>
|
||||
Sounds,
|
||||
/// <summary>
|
||||
/// Represents the Rows tab.
|
||||
/// </summary>
|
||||
Rows,
|
||||
/// <summary>
|
||||
/// Represents the Actions tab.
|
||||
/// </summary>
|
||||
Actions,
|
||||
/// <summary>
|
||||
/// Represents the Decorations tab.
|
||||
/// </summary>
|
||||
Decorations,
|
||||
/// <summary>
|
||||
/// Represents the Rooms tab.
|
||||
/// </summary>
|
||||
Rooms,
|
||||
/// <summary>
|
||||
/// Represents an unknown tab.
|
||||
/// </summary>
|
||||
Unknown
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using Newtonsoft.Json;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a tag action event.
|
||||
/// </summary>
|
||||
public class TagAction : BaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TagAction"/> class.
|
||||
/// </summary>
|
||||
public TagAction()
|
||||
{
|
||||
Type = EventType.TagAction;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the action associated with the tag.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public Actions Action { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the action tag.
|
||||
/// </summary>
|
||||
[JsonProperty("Tag")]
|
||||
public string ActionTag { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", ActionTag);
|
||||
|
||||
/// <summary>
|
||||
/// Defines the possible actions for a tag.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum Actions
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the run action.
|
||||
/// </summary>
|
||||
Run = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Represents all actions.
|
||||
/// </summary>
|
||||
All = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Represents the enable action.
|
||||
/// </summary>
|
||||
Enable = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Represents the disable action.
|
||||
/// </summary>
|
||||
Disable = 4
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines special tags for the action.
|
||||
/// </summary>
|
||||
public enum SpecialTag
|
||||
{
|
||||
#pragma warning disable CS1591
|
||||
onHit,
|
||||
onMiss,
|
||||
onHeldPressHit,
|
||||
onHeldReleaseHit,
|
||||
onHeldPressMiss,
|
||||
onHeldReleaseMiss,
|
||||
row0,
|
||||
row1,
|
||||
row2,
|
||||
row3,
|
||||
row4,
|
||||
row5,
|
||||
row6,
|
||||
row7,
|
||||
row8,
|
||||
row9,
|
||||
row10,
|
||||
row11,
|
||||
row12,
|
||||
row13,
|
||||
row14,
|
||||
row15
|
||||
#pragma warning restore CS1591
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
using RhythmBase.Components;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a text explosion event in a room.
|
||||
/// </summary>
|
||||
public class TextExplosion : BaseEvent, IRoomEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TextExplosion"/> class.
|
||||
/// </summary>
|
||||
public TextExplosion()
|
||||
{
|
||||
Rooms = new RDRoom(false, new byte[1]);
|
||||
Color = new PaletteColor(false);
|
||||
Type = EventType.TextExplosion;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the rooms associated with the text explosion.
|
||||
/// </summary>
|
||||
public RDRoom Rooms { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the color of the text explosion.
|
||||
/// </summary>
|
||||
public PaletteColor Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text to be displayed in the explosion.
|
||||
/// </summary>
|
||||
public string Text { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the direction of the text explosion.
|
||||
/// </summary>
|
||||
public Directions Direction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the mode of the text explosion.
|
||||
/// </summary>
|
||||
public Modes Mode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}", Text);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the direction of the text explosion.
|
||||
/// </summary>
|
||||
public enum Directions
|
||||
{
|
||||
/// <summary>
|
||||
/// The text explodes to the left.
|
||||
/// </summary>
|
||||
Left,
|
||||
|
||||
/// <summary>
|
||||
/// The text explodes to the right.
|
||||
/// </summary>
|
||||
Right
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the mode of the text explosion.
|
||||
/// </summary>
|
||||
public enum Modes
|
||||
{
|
||||
/// <summary>
|
||||
/// The text explosion uses one color.
|
||||
/// </summary>
|
||||
OneColor,
|
||||
|
||||
/// <summary>
|
||||
/// The text explosion uses random colors.
|
||||
/// </summary>
|
||||
Random
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a tile event in the rhythm base system.
|
||||
/// </summary>
|
||||
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
|
||||
public class Tile : BaseDecorationAction, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Tile"/> class.
|
||||
/// </summary>
|
||||
public Tile()
|
||||
{
|
||||
Type = EventType.Tile;
|
||||
Tab = Tabs.Decorations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab associated with the event.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of the tile.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPoint? Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tiling of the tile.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPoint? Tiling { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the speed of the tile.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public RDPoint? Speed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of tiling.
|
||||
/// </summary>
|
||||
public TilingTypes TilingType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the interval for the tiling.
|
||||
/// </summary>
|
||||
public float Interval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Y coordinate. Always returns 0.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public override int Y => 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type for the event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the types of tiling available.
|
||||
/// </summary>
|
||||
public enum TilingTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a scrolling tiling type.
|
||||
/// </summary>
|
||||
Scroll,
|
||||
|
||||
/// <summary>
|
||||
/// Represents a pulsing tiling type.
|
||||
/// </summary>
|
||||
Pulse
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the types of tiling that can be applied.
|
||||
/// </summary>
|
||||
public enum TilingTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Tiling type where the content scrolls.
|
||||
/// </summary>
|
||||
Scroll,
|
||||
|
||||
/// <summary>
|
||||
/// Tiling type where the content pulses.
|
||||
/// </summary>
|
||||
Pulse
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Tint event which is a type of BaseDecorationAction and implements IEaseEvent.
|
||||
/// </summary>
|
||||
public class Tint : BaseDecorationAction, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Tint"/> class.
|
||||
/// </summary>
|
||||
public Tint()
|
||||
{
|
||||
BorderColor = new PaletteColor(true);
|
||||
TintColor = new PaletteColor(true)
|
||||
{
|
||||
Color = RDColor.White
|
||||
};
|
||||
Type = EventType.Tint;
|
||||
Tab = Tabs.Decorations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ease type for the tint event.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border type for the tint event.
|
||||
/// </summary>
|
||||
public Borders Border { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border color for the tint event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the opacity for the tint event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public int Opacity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this event is a tint.
|
||||
/// </summary>
|
||||
[JsonProperty("tint")]
|
||||
public bool IsTint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tint color for the tint event.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor TintColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the tint event.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the event.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab where the event is categorized.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}{1}", Border, (Border == Borders.None) ? "" : (":" + BorderColor.ToString()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using Newtonsoft.Json;
|
||||
using RhythmBase.Components;
|
||||
using RhythmBase.Components.Easing;
|
||||
namespace RhythmBase.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an event that tints rows with specified colors and effects.
|
||||
/// </summary>
|
||||
public class TintRows : BaseRowAnimation, IEaseEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TintRows"/> class.
|
||||
/// </summary>
|
||||
public TintRows()
|
||||
{
|
||||
TintColor = new PaletteColor(true);
|
||||
BorderColor = new PaletteColor(true);
|
||||
Type = EventType.TintRows;
|
||||
Tab = Tabs.Actions;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tint color.
|
||||
/// </summary>
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public PaletteColor TintColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the easing type for the animation.
|
||||
/// </summary>
|
||||
public EaseType Ease { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border style.
|
||||
/// </summary>
|
||||
public Borders Border { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the border color.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public PaletteColor BorderColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the opacity level.
|
||||
/// </summary>
|
||||
[EaseProperty]
|
||||
public int Opacity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to apply tint.
|
||||
/// </summary>
|
||||
public bool Tint { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the duration of the tint effect.
|
||||
/// </summary>
|
||||
public float Duration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the row effect.
|
||||
/// </summary>
|
||||
public RowEffect Effect { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the event type.
|
||||
/// </summary>
|
||||
public override EventType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tab category.
|
||||
/// </summary>
|
||||
public override Tabs Tab { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether to tint all rows.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool TintAll
|
||||
{
|
||||
get
|
||||
{
|
||||
return Parent != null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the current object.
|
||||
/// </summary>
|
||||
/// <returns>A string that represents the current object.</returns>
|
||||
public override string ToString() => base.ToString() + string.Format(" {0}{1}", Border, (Border == Borders.None) ? "" : (":" + BorderColor.ToString()));
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the row effects.
|
||||
/// </summary>
|
||||
public enum RowEffect
|
||||
{
|
||||
/// <summary>
|
||||
/// No effect.
|
||||
/// </summary>
|
||||
None,
|
||||
|
||||
/// <summary>
|
||||
/// Electric effect.
|
||||
/// </summary>
|
||||
Electric,
|
||||
|
||||
/// <summary>
|
||||
/// Smoke effect.
|
||||
/// </summary>
|
||||
Smoke
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user