Files
crystall-punk-14/Content.Shared/Cooldown/ItemCooldownComponent.cs

52 lines
1.4 KiB
C#
Raw Normal View History

using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
2021-06-09 22:19:39 +02:00
namespace Content.Shared.Cooldown
{
/// <summary>
/// Stores a visual "cooldown" for items, that gets displayed in the hands GUI.
/// </summary>
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class ItemCooldownComponent : Component
{
// TODO: access and system setting and dirtying not this funny stuff
private TimeSpan? _cooldownEnd;
private TimeSpan? _cooldownStart;
/// <summary>
/// The time when this cooldown ends.
/// </summary>
/// <remarks>
/// If null, no cooldown is displayed.
/// </remarks>
[ViewVariables, AutoNetworkedField]
public TimeSpan? CooldownEnd
{
get => _cooldownEnd;
set
{
_cooldownEnd = value;
Dirty();
}
}
/// <summary>
/// The time when this cooldown started.
/// </summary>
/// <remarks>
/// If null, no cooldown is displayed.
/// </remarks>
[ViewVariables, AutoNetworkedField]
public TimeSpan? CooldownStart
{
get => _cooldownStart;
set
{
_cooldownStart = value;
Dirty();
}
}
}
}