using Content.Server.Ghost.Roles.Raffles; using Robust.Shared.Player; namespace Content.Server.Ghost.Roles.Components; /// /// Indicates that a ghost role is currently being raffled, and stores data about the raffle in progress. /// Raffles start when the first player joins a raffle. /// [RegisterComponent] [Access(typeof(GhostRoleSystem))] public sealed partial class GhostRoleRaffleComponent : Component { /// /// Identifier of the Ghost Role this raffle is for. /// [ViewVariables(VVAccess.ReadOnly)] [DataField] public uint Identifier { get; set; } /// /// List of sessions that are currently in the raffle. /// [ViewVariables(VVAccess.ReadOnly)] public HashSet CurrentMembers = []; /// /// List of sessions that are currently or were previously in the raffle. /// [ViewVariables(VVAccess.ReadOnly)] public HashSet AllMembers = []; /// /// Time left in the raffle in seconds. This must be initialized to a positive value. /// [ViewVariables(VVAccess.ReadOnly)] [DataField] public TimeSpan Countdown = TimeSpan.MaxValue; /// /// The cumulative time, i.e. how much time the raffle will take in total. Added to when the time is extended /// by someone joining the raffle. /// Must be set to the same value as on initialization. /// [ViewVariables(VVAccess.ReadOnly)] [DataField("cumulativeTime")] public TimeSpan CumulativeTime = TimeSpan.MaxValue; /// [ViewVariables(VVAccess.ReadOnly)] [DataField("joinExtendsDurationBy")] public TimeSpan JoinExtendsDurationBy { get; set; } /// [ViewVariables(VVAccess.ReadOnly)] [DataField("maxDuration")] public TimeSpan MaxDuration { get; set; } }