using System; using Verse; namespace BlaxLaws { /// /// A law's stage. Planning: a break has started and nothing is done yet (break entries only). Did it: /// the act happened. Saved by name, so the names never change. /// public enum LawStage { Planning, DidIt, } /// A law's severity. Sets the default days (1, 3, 5, 10) and orders the case log. Saved by name. public enum LawSeverity { Minor, Moderate, Serious, Grave, } /// Where a case stands. Saved by name. public enum CaseStatus { /// Filed; nothing runs yet, or it waits (no bed, no enforcer, danger, a hold). Open, /// An enforcer is on it (a subdue, an arrest or a capture job). Enforcing, /// The offender serves a sentence in Laws' custody. Jailed, /// Done; LawCase.outcome says how. Closed, } /// Notes a case keeps about the act ("on a table", "dug up from a grave"). Saved by name. [Flags] public enum CaseNotes { None = 0, OnTable = 1, DugUp = 2, } /// /// What a hook read from the thing itself, before it could be destroyed (hook C's prefix), for groups /// that depend on the thing rather than its def: a meal with meat in it, human meat. Not saved. /// [Flags] public enum ActFacts { None = 0, /// Any meat, meals with meat included (FoodUtility.GetFoodKind). Meat = 1, /// Raw meat or a corpse, unprocessed. RawMeatOrCorpse = 2, /// Human meat, a humanlike corpse or an ingredient of either. HumanMeat = 4, /// Insect meat. InsectMeat = 8, /// Raw food (ingestible preferability). RawFood = 16, /// A meal (processed food). Meal = 32, } /// Which stages of a case have had their punishment dispatched. Saved by name. [Flags] public enum StageMask { None = 0, Planning = 1, DidIt = 2, } /// /// The entry kind and stage a punishment fits (design: "Lawbook tab", punishments per entry and stage). /// Read from PunishmentDef.fits in XML. /// public enum PunishmentFit { /// A break that isn't hostile to the colony, at planning. BreakPlanning, /// A break that isn't hostile to the colony, at did it. BreakDidIt, /// A break hostile to the colony (berserk), at planning. HostileBreakPlanning, /// A break hostile to the colony (berserk), at did it. HostileBreakDidIt, /// Every entry outside the breaks: ate, used, interactions, recorded acts, records, bills, special acts. Act, } /// What an Enforcement queue entry does when it comes due. public enum CaseTask { /// Start the punishment of the case's law for the entry's stage (PunishmentWorker.Start). Punish, /// Write "Maintain only" on a pawn Laws just jailed (Sentences.WriteMaintainOnly). MaintainOnly, } /// Outcome keys of closed cases. The label is "BlaxLaws_Outcome_" + key. Saved as strings. public static class CaseOutcomes { public const string Repealed = "Repealed"; public const string BreakEnded = "BreakEnded"; public const string NotEnforced = "NotEnforced"; public const string OffenderGone = "OffenderGone"; public const string Warned = "Warned"; public const string Guilty = "Guilty"; public const string Subdued = "Subdued"; public const string Served = "Served"; public const string ReleasedEarly = "ReleasedEarly"; /// The outcome's label, or the key itself when no string exists (an outcome a later release added). public static string Label(string key) { if (key.NullOrEmpty()) return ""; string k = "BlaxLaws_Outcome_" + key; return k.CanTranslate() ? k.Translate().ToString() : key; } } /// Labels for the enums, from Keyed. public static class LawLabels { public static string Stage(LawStage stage) => ("BlaxLaws_Stage_" + stage).Translate(); public static string Severity(LawSeverity severity) => ("BlaxLaws_Severity_" + severity).Translate(); public static string Status(CaseStatus status) => ("BlaxLaws_Status_" + status).Translate(); public static StageMask Mask(LawStage stage) => stage == LawStage.Planning ? StageMask.Planning : StageMask.DidIt; } }