From 5a9fa1ef674824b29fdbaa22b6741782be1b8743 Mon Sep 17 00:00:00 2001 From: portfiend <109661617+portfiend@users.noreply.github.com> Date: Thu, 18 Jun 2026 13:41:56 -0500 Subject: [PATCH] Document Client, Server, and Shared files in folders starting with "K". Except microwaves. (#91) * document the entire owl * Apply suggestions from code review Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- .../EntitySystems/ReagentGrinderSystem.cs | 1 + Content.Client/Kitchen/UI/GrinderMenu.xaml.cs | 8 +++++++ .../Kitchen/UI/LabelledContentBox.xaml.cs | 24 +++++++++++++------ .../UI/ReagentGrinderBoundUserInterface.cs | 19 +++++++++++++++ .../Kudzu/KudzuVisualizerComponent.cs | 24 ++++++++++++------- .../KillTracking/KillTrackerComponent.cs | 6 +++++ .../KillTracking/KillTrackingSystem.cs | 3 +-- .../EntitySystems/ReagentGrinderSystem.cs | 1 + .../SharedReagentGrinderSystem.cs | 4 ++++ .../Kitchen/SharedKitchenSpikeSystem.cs | 9 +++++++ 10 files changed, 82 insertions(+), 17 deletions(-) diff --git a/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs index 3dafecbc89..7a438d69de 100644 --- a/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs +++ b/Content.Client/Kitchen/EntitySystems/ReagentGrinderSystem.cs @@ -4,6 +4,7 @@ using Content.Shared.Kitchen.EntitySystems; namespace Content.Client.Kitchen.EntitySystems; +/// public sealed partial class ReagentGrinderSystem : SharedReagentGrinderSystem { [Dependency] private SharedUserInterfaceSystem _userInterface = default!; diff --git a/Content.Client/Kitchen/UI/GrinderMenu.xaml.cs b/Content.Client/Kitchen/UI/GrinderMenu.xaml.cs index 2770e163d3..3638794a09 100644 --- a/Content.Client/Kitchen/UI/GrinderMenu.xaml.cs +++ b/Content.Client/Kitchen/UI/GrinderMenu.xaml.cs @@ -58,12 +58,20 @@ public sealed partial class GrinderMenu : FancyWindow OnEjectChamber?.Invoke(_chamberVisualContents[args.ItemIndex]); } + /// + /// Set the reagent grinder entity associated with this menu. + /// + /// The reagent grinder. public void SetEntity(EntityUid owner) { _owner = owner; UpdateUi(); } + /// + /// Update the UI state of this reagent grinder, including its contents, + /// current grinding/juicing status, and button toggle states. + /// public void UpdateUi() { if (!_entityManager.TryGetComponent(_owner, out var grinderComp)) diff --git a/Content.Client/Kitchen/UI/LabelledContentBox.xaml.cs b/Content.Client/Kitchen/UI/LabelledContentBox.xaml.cs index bcad17ae97..ff8ce8a74e 100644 --- a/Content.Client/Kitchen/UI/LabelledContentBox.xaml.cs +++ b/Content.Client/Kitchen/UI/LabelledContentBox.xaml.cs @@ -1,12 +1,22 @@ using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; -namespace Content.Client.Kitchen.UI +namespace Content.Client.Kitchen.UI; + +/// +/// A box representing the input or output contents of a reagent grinder, +/// with a button to eject the contents on the input / output side. +/// +[GenerateTypedNameReferences] +public sealed partial class LabelledContentBox : BoxContainer { - [GenerateTypedNameReferences] - public sealed partial class LabelledContentBox : BoxContainer - { - public string? LabelText { get => Label.Text; set => Label.Text = value; } - public string? ButtonText { get => EjectButton.Text; set => EjectButton.Text = value; } - } + /// + /// The name of the container, e.g. "Chamber" or "Beaker". + /// + public string? LabelText { get => Label.Text; set => Label.Text = value; } + + /// + /// The text for the eject button. + /// + public string? ButtonText { get => EjectButton.Text; set => EjectButton.Text = value; } } diff --git a/Content.Client/Kitchen/UI/ReagentGrinderBoundUserInterface.cs b/Content.Client/Kitchen/UI/ReagentGrinderBoundUserInterface.cs index f7a31e1e58..6055d74e2c 100644 --- a/Content.Client/Kitchen/UI/ReagentGrinderBoundUserInterface.cs +++ b/Content.Client/Kitchen/UI/ReagentGrinderBoundUserInterface.cs @@ -31,31 +31,50 @@ public sealed class ReagentGrinderBoundUserInterface(EntityUid owner, Enum uiKey _menu?.UpdateUi(); } + /// + /// Send a message to toggle automatic grinding mode for this grinder. + /// public void ToggleAutoMode() { SendPredictedMessage(new ReagentGrinderToggleAutoModeMessage()); } + /// + /// Send a message to begin grinding the grinder's contents. + /// public void StartGrinding() { SendPredictedMessage(new ReagentGrinderStartMessage(GrinderProgram.Grind)); } + /// + /// Send a message to begin juicing the grinder's contents. + /// public void StartJuicing() { SendPredictedMessage(new ReagentGrinderStartMessage(GrinderProgram.Juice)); } + /// + /// Send a message to request all entities be ejected from the grinder. + /// public void EjectAll() { SendPredictedMessage(new ReagentGrinderEjectChamberAllMessage()); } + /// + /// Send a message to remove the reagent container from the grinder. + /// public void EjectBeaker() { SendPredictedMessage(new ItemSlotButtonPressedEvent(ReagentGrinderComponent.BeakerSlotId)); } + /// + /// Send a message to request a specific entity be ejected from the grinder. + /// + /// The entity to eject. public void EjectChamberContent(EntityUid uid) { SendPredictedMessage(new ReagentGrinderEjectChamberContentMessage(EntMan.GetNetEntity(uid))); diff --git a/Content.Client/Kudzu/KudzuVisualizerComponent.cs b/Content.Client/Kudzu/KudzuVisualizerComponent.cs index 868f2841f8..5f48a16320 100644 --- a/Content.Client/Kudzu/KudzuVisualizerComponent.cs +++ b/Content.Client/Kudzu/KudzuVisualizerComponent.cs @@ -1,10 +1,18 @@ -namespace Content.Client.Kudzu -{ - [RegisterComponent] - public sealed partial class KudzuVisualsComponent : Component - { - [DataField("layer")] - public int Layer { get; private set; } = 0; - } +using Content.Shared.Spreader; +namespace Content.Client.Kudzu; + +/// +/// Entities that have a visual state corresponding to current growth level +/// and random variation, for kudzu tiles. +/// +/// +[RegisterComponent] +public sealed partial class KudzuVisualsComponent : Component +{ + /// + /// The index of the sprite layer that is reflecting the kudzu's growth state. + /// + [DataField] + public int Layer { get; private set; } = 0; } diff --git a/Content.Server/KillTracking/KillTrackerComponent.cs b/Content.Server/KillTracking/KillTrackerComponent.cs index aad6671df9..a81a4bdf9b 100644 --- a/Content.Server/KillTracking/KillTrackerComponent.cs +++ b/Content.Server/KillTracking/KillTrackerComponent.cs @@ -31,6 +31,9 @@ public abstract record KillSource; [DataDefinition, Serializable] public sealed partial record KillPlayerSource : KillSource { + /// + /// The player that has attacked this target. + /// [DataField("playerId")] public NetUserId PlayerId; @@ -46,6 +49,9 @@ public sealed partial record KillPlayerSource : KillSource [DataDefinition, Serializable] public sealed partial record KillNpcSource : KillSource { + /// + /// The NPC that has attacked this target. + /// [DataField("npcEnt")] public EntityUid NpcEnt; diff --git a/Content.Server/KillTracking/KillTrackingSystem.cs b/Content.Server/KillTracking/KillTrackingSystem.cs index d40e0e13dd..a857c0c6a7 100644 --- a/Content.Server/KillTracking/KillTrackingSystem.cs +++ b/Content.Server/KillTracking/KillTrackingSystem.cs @@ -1,5 +1,4 @@ using Content.Server.NPC.HTN; -using Content.Shared.Damage; using Content.Shared.Damage.Systems; using Content.Shared.FixedPoint; using Content.Shared.Mobs; @@ -17,7 +16,7 @@ public sealed class KillTrackingSystem : EntitySystem public override void Initialize() { // Add damage to LifetimeDamage before MobStateChangedEvent gets raised - SubscribeLocalEvent(OnDamageChanged, before: [ typeof(MobThresholdSystem) ]); + SubscribeLocalEvent(OnDamageChanged, before: [typeof(MobThresholdSystem)]); SubscribeLocalEvent(OnMobStateChanged); } diff --git a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs index 81bcc9d159..7dc9094db2 100644 --- a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs @@ -2,4 +2,5 @@ using Content.Shared.Kitchen.EntitySystems; namespace Content.Server.Kitchen.EntitySystems; +/// public sealed class ReagentGrinderSystem : SharedReagentGrinderSystem; diff --git a/Content.Shared/Kitchen/EntitySystems/SharedReagentGrinderSystem.cs b/Content.Shared/Kitchen/EntitySystems/SharedReagentGrinderSystem.cs index 49c1c005b4..f553068f09 100644 --- a/Content.Shared/Kitchen/EntitySystems/SharedReagentGrinderSystem.cs +++ b/Content.Shared/Kitchen/EntitySystems/SharedReagentGrinderSystem.cs @@ -20,6 +20,10 @@ using Robust.Shared.Timing; namespace Content.Shared.Kitchen.EntitySystems; +/// +/// Entity system for the reagent grinder, a device that can grind solid objects into +/// reagents in an inserted container. +/// [UsedImplicitly] public abstract partial class SharedReagentGrinderSystem : EntitySystem { diff --git a/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs b/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs index 375e42f0e6..7831097b92 100644 --- a/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs +++ b/Content.Shared/Kitchen/SharedKitchenSpikeSystem.cs @@ -487,11 +487,20 @@ public sealed partial class SharedKitchenSpikeSystem : EntitySystem } } +/// +/// DoAfter event for putting an entity on a meat spike. +/// [Serializable, NetSerializable] public sealed partial class SpikeHookDoAfterEvent : SimpleDoAfterEvent; +/// +/// DoAfter event for removing an entity from a meat spike. +/// [Serializable, NetSerializable] public sealed partial class SpikeUnhookDoAfterEvent : SimpleDoAfterEvent; +/// +/// DoAfter event for slicing an entity on a meat spike. +/// [Serializable, NetSerializable] public sealed partial class SpikeButcherDoAfterEvent : SimpleDoAfterEvent;