Add TryGetPrimaryDepartment to jobs system (#23317)

* add primary departments

* make command and station specific secondary

* add a unit test

* fixy

* compile

* webedit ops

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-01-14 08:18:34 +00:00
committed by GitHub
parent 1346cc051d
commit d1d11d09c7
4 changed files with 81 additions and 0 deletions

View File

@@ -23,4 +23,11 @@ public sealed partial class DepartmentPrototype : IPrototype
[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;
}