Add active and ended game rule components, generic TryRoundStartAttempt and minPlayers field (#20564)
* Improve active game rule querying, add generic try round start attempt method, move minPlayers to GameRuleComponent * Nukeops todo and cleanup * Remove Active field * Add EndedGameRuleComponent
This commit is contained in:
@@ -9,25 +9,17 @@ namespace Content.Server.GameTicking.Rules.Components;
|
||||
[RegisterComponent]
|
||||
public sealed partial class GameRuleComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether or not the rule is active.
|
||||
/// Is enabled after <see cref="GameRuleStartedEvent"/> and disabled after <see cref="GameRuleEndedEvent"/>
|
||||
/// </summary>
|
||||
[DataField("active")]
|
||||
public bool Active;
|
||||
|
||||
/// <summary>
|
||||
/// Game time when game rule was activated
|
||||
/// </summary>
|
||||
[DataField("activatedAt", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan ActivatedAt;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not the gamerule finished.
|
||||
/// Used for tracking whether a non-active gamerule has been started before.
|
||||
/// The minimum amount of players needed for this game rule.
|
||||
/// </summary>
|
||||
[DataField("ended")]
|
||||
public bool Ended;
|
||||
[DataField]
|
||||
public int MinPlayers;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user