CatStation/Content.Server/Chat/AutoEmoteComponent.cs
deltanedas cf7fde3d62
Big prototype and datafield cleanup (#45202)
* giant protoid cleanup

* yml changes

* !

---------

Co-authored-by: deltanedas <@deltanedas:goida.zip>
2026-08-12 02:07:22 +00:00

32 lines
1.2 KiB
C#

using Content.Server.Chat.Systems;
using Content.Shared.Chat.Prototypes;
using Robust.Shared.Prototypes;
namespace Content.Server.Chat;
/// <summary>
/// Causes an entity to automatically emote at a set interval.
/// </summary>
[RegisterComponent, Access(typeof(AutoEmoteSystem))]
public sealed partial class AutoEmoteComponent : Component
{
/// <summary>
/// A set of emotes that the entity will preform.
/// <see cref="AutoEmotePrototype"/>
/// </summary>
[DataField]
public HashSet<ProtoId<AutoEmotePrototype>> Emotes = new();
/// <summary>
/// A dictionary storing the time of the next emote attempt for each emote.
/// Uses AutoEmotePrototype IDs as keys.
/// <summary>
[ViewVariables(VVAccess.ReadOnly)] //TODO: make this a datafield and (de)serialize values as time offsets when https://github.com/space-wizards/RobustToolbox/issues/3768 is fixed
public Dictionary<string, TimeSpan> EmoteTimers = new();
/// <summary>
/// Time of the next emote. Redundant, but avoids having to iterate EmoteTimers each update.
/// </summary>
[ViewVariables(VVAccess.ReadOnly)]
public TimeSpan NextEmoteTime = TimeSpan.MaxValue;
}