rimworld-blax-laws/Source/BlaxLaws/Enforcement/PunishmentWorker_Warn.cs

21 lines
775 B
C#

using Verse;
namespace BlaxLaws
{
/// <summary>
/// Warn: the case's message is the record (CaseMessages.Filed, posted by Enforcement at dispatch). Closes
/// the case as Warned once its stage is done, unless an earlier stage's punishment still runs beside it
/// ("Warn and Guilty run alongside"). A later did-it act reopens a closed break case (CaseFiler).
/// Design: "Warn and guilty".
/// </summary>
public class PunishmentWorker_Warn : PunishmentWorker
{
public override void Start(LawCase c, Law law, LawStage stage)
{
if (c == null || c.IsClosed || !c.activePunishment.NullOrEmpty())
return;
GameComponent_BlaxLaws.Instance?.CloseCase(c, CaseOutcomes.Warned);
}
}
}