CatStation/Content.Shared/Roles/JobWeightPrototype.cs
metalgearsloth 4310a9e6d8
Job weight rework (#45056)
* Job weight rework

Instead of global job priorities we do:
- Fill up minimum job slots first by priority. Has same-department / anyone / never fallbacks.
- Players get their jobs by pref, filling up up to roundstart values on gamemapprototype (AKA maximums)

Default weights are used if the map doesn't specify.

* a

* I square to god
2026-08-08 01:44:53 +00:00

23 lines
859 B
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.Roles;
/// <summary>
/// Defines the order in which jobs are assigned to their round-start minimum slots and displayed.
/// Job weights do not affect assignments made after every station's minimum slots have been considered.
/// Map-specific profiles override the entries they contain; all other entries use <see cref="Default"/>.
/// </summary>
[Prototype]
public sealed partial class JobWeightPrototype : IPrototype
{
/// <summary>
/// The global fallback profile used by maps that do not define an override.
/// </summary>
public static readonly ProtoId<JobWeightPrototype> Default = "Default";
[IdDataField]
public string ID { get; private set; } = string.Empty;
[DataField]
public Dictionary<ProtoId<JobPrototype>, int> Weights { get; private set; } = new();
}