Files
tbd-station-14/Content.Shared/Roles/DepartmentPrototype.cs
Kot 4f307a49be Fix issue where round could reset all job priorities to high (#24340)
* Update job priorities when job requirements are getting updated

* Sort jobs by weight and then by the name

* Sort departments too
2024-01-20 17:03:10 -05:00

40 lines
1.3 KiB
C#

using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Roles;
[Prototype("department")]
public sealed partial class DepartmentPrototype : IPrototype
{
[IdDataField] public string ID { get; } = default!;
/// <summary>
/// A description string to display in the character menu as an explanation of the department's function.
/// </summary>
[DataField("description", required: true)]
public string Description = default!;
/// <summary>
/// A color representing this department to use for text.
/// </summary>
[DataField("color", required: true)]
public Color Color = default!;
[ViewVariables(VVAccess.ReadWrite),
DataField("roles", customTypeSerializer: typeof(PrototypeIdListSerializer<JobPrototype>))]
public List<string> Roles = new();
/// <summary>
/// Whether this is a primary department or not.
/// For example, CE's primary department is engineering since Command has primary: false.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool Primary = true;
/// <summary>
/// Departments with a higher weight sorted before other departments in UI.
/// </summary>
[DataField("weight")]
public int Weight { get; private set; } = 0;
}