using Content.Shared.EntityTable.EntitySelectors;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.GameTicking.Rules;
///
/// Gamerule the spawns multiple antags at intervals based on a budget
///
[RegisterComponent, AutoGenerateComponentPause]
public sealed partial class DynamicRuleComponent : Component
{
///
/// The total budget for antags.
///
[DataField]
public float Budget;
///
/// The last time budget was updated.
///
[DataField]
public TimeSpan LastBudgetUpdate;
///
/// The amount of budget accumulated every second.
///
[DataField]
public float BudgetPerSecond = 0.1f;
///
/// The minimum or lower bound for budgets to start at.
///
[DataField]
public int StartingBudgetMin = 200;
///
/// The maximum or upper bound for budgets to start at.
///
[DataField]
public int StartingBudgetMax = 350;
///
/// The time at which the next rule will start
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextRuleTime;
///
/// Minimum delay between rules
///
[DataField]
public TimeSpan MinRuleInterval = TimeSpan.FromMinutes(10);
///
/// Maximum delay between rules
///
[DataField]
public TimeSpan MaxRuleInterval = TimeSpan.FromMinutes(30);
///
/// A table of rules that are picked from.
///
[DataField]
public EntityTableSelector Table = new NoneSelector();
///
/// The rules that have been spawned
///
[DataField]
public List Rules = new();
}