namespace Content.Server.GameTicking.Rules.Components; /// /// Component attached to all gamerule entities. /// Used to both track the entity as well as store basic data /// [RegisterComponent] public sealed class GameRuleComponent : Component { /// /// Whether or not the rule is active. /// Is enabled after and disabled after /// [DataField("active")] public bool Active; /// /// Whether or not the gamerule finished. /// Used for tracking whether a non-active gamerule has been started before. /// [DataField("ended")] public bool Ended; } /// /// Raised when a rule is added but hasn't formally begun yet. /// Good for announcing station events and other such things. /// [ByRefEvent] public readonly record struct GameRuleAddedEvent(EntityUid RuleEntity, string RuleId); /// /// Raised when the rule actually begins. /// Player-facing logic should begin here. /// [ByRefEvent] public readonly record struct GameRuleStartedEvent(EntityUid RuleEntity, string RuleId); /// /// Raised when the rule ends. /// Do cleanup and other such things here. /// [ByRefEvent] public readonly record struct GameRuleEndedEvent(EntityUid RuleEntity, string RuleId);