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>
This commit is contained in:
portfiend 2026-06-18 13:41:56 -05:00 • committed by GitHub
parent ee45f5c27c
commit 5a9fa1ef67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 82 additions and 17 deletions

View file

@ -4,6 +4,7 @@ using Content.Shared.Kitchen.EntitySystems;
namespace Content.Client.Kitchen.EntitySystems;
/// <inheritdoc />
public sealed partial class ReagentGrinderSystem : SharedReagentGrinderSystem
{
[Dependency] private SharedUserInterfaceSystem _userInterface = default!;

View file

@ -58,12 +58,20 @@ public sealed partial class GrinderMenu : FancyWindow
OnEjectChamber?.Invoke(_chamberVisualContents[args.ItemIndex]);
}
/// <summary>
/// Set the reagent grinder entity associated with this menu.
/// </summary>
/// <param name="owner">The reagent grinder.</param>
public void SetEntity(EntityUid owner)
{
_owner = owner;
UpdateUi();
}
/// <summary>
/// Update the UI state of this reagent grinder, including its contents,
/// current grinding/juicing status, and button toggle states.
/// </summary>
public void UpdateUi()
{
if (!_entityManager.TryGetComponent<ReagentGrinderComponent>(_owner, out var grinderComp))

View file

@ -1,12 +1,22 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
namespace Content.Client.Kitchen.UI
namespace Content.Client.Kitchen.UI;
/// <summary>
/// A box representing the input or output contents of a reagent grinder,
/// with a button to eject the contents on the input / output side.
/// </summary>
[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; }
}
/// <summary>
/// The name of the container, e.g. "Chamber" or "Beaker".
/// </summary>
public string? LabelText { get => Label.Text; set => Label.Text = value; }
/// <summary>
/// The text for the eject button.
/// </summary>
public string? ButtonText { get => EjectButton.Text; set => EjectButton.Text = value; }
}

View file

@ -31,31 +31,50 @@ public sealed class ReagentGrinderBoundUserInterface(EntityUid owner, Enum uiKey
_menu?.UpdateUi();
}
/// <summary>
/// Send a message to toggle automatic grinding mode for this grinder.
/// </summary>
public void ToggleAutoMode()
{
SendPredictedMessage(new ReagentGrinderToggleAutoModeMessage());
}
/// <summary>
/// Send a message to begin grinding the grinder's contents.
/// </summary>
public void StartGrinding()
{
SendPredictedMessage(new ReagentGrinderStartMessage(GrinderProgram.Grind));
}
/// <summary>
/// Send a message to begin juicing the grinder's contents.
/// </summary>
public void StartJuicing()
{
SendPredictedMessage(new ReagentGrinderStartMessage(GrinderProgram.Juice));
}
/// <summary>
/// Send a message to request all entities be ejected from the grinder.
/// </summary>
public void EjectAll()
{
SendPredictedMessage(new ReagentGrinderEjectChamberAllMessage());
}
/// <summary>
/// Send a message to remove the reagent container from the grinder.
/// </summary>
public void EjectBeaker()
{
SendPredictedMessage(new ItemSlotButtonPressedEvent(ReagentGrinderComponent.BeakerSlotId));
}
/// <summary>
/// Send a message to request a specific entity be ejected from the grinder.
/// </summary>
/// <param name="uid">The entity to eject.</param>
public void EjectChamberContent(EntityUid uid)
{
SendPredictedMessage(new ReagentGrinderEjectChamberContentMessage(EntMan.GetNetEntity(uid)));

View file

@ -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;
/// <summary>
/// Entities that have a visual state corresponding to current growth level
/// and random variation, for kudzu tiles.
/// <seealso cref="KudzuVisuals"/>
/// </summary>
[RegisterComponent]
public sealed partial class KudzuVisualsComponent : Component
{
/// <summary>
/// The index of the sprite layer that is reflecting the kudzu's growth state.
/// </summary>
[DataField]
public int Layer { get; private set; } = 0;
}

View file

@ -31,6 +31,9 @@ public abstract record KillSource;
[DataDefinition, Serializable]
public sealed partial record KillPlayerSource : KillSource
{
/// <summary>
/// The player that has attacked this target.
/// </summary>
[DataField("playerId")]
public NetUserId PlayerId;
@ -46,6 +49,9 @@ public sealed partial record KillPlayerSource : KillSource
[DataDefinition, Serializable]
public sealed partial record KillNpcSource : KillSource
{
/// <summary>
/// The NPC that has attacked this target.
/// </summary>
[DataField("npcEnt")]
public EntityUid NpcEnt;

View file

@ -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<KillTrackerComponent, DamageChangedEvent>(OnDamageChanged, before: [ typeof(MobThresholdSystem) ]);
SubscribeLocalEvent<KillTrackerComponent, DamageChangedEvent>(OnDamageChanged, before: [typeof(MobThresholdSystem)]);
SubscribeLocalEvent<KillTrackerComponent, MobStateChangedEvent>(OnMobStateChanged);
}

View file

@ -2,4 +2,5 @@ using Content.Shared.Kitchen.EntitySystems;
namespace Content.Server.Kitchen.EntitySystems;
/// <inheritdoc />
public sealed class ReagentGrinderSystem : SharedReagentGrinderSystem;

View file

@ -20,6 +20,10 @@ using Robust.Shared.Timing;
namespace Content.Shared.Kitchen.EntitySystems;
/// <summary>
/// Entity system for the reagent grinder, a device that can grind solid objects into
/// reagents in an inserted container.
/// </summary>
[UsedImplicitly]
public abstract partial class SharedReagentGrinderSystem : EntitySystem
{

View file

@ -487,11 +487,20 @@ public sealed partial class SharedKitchenSpikeSystem : EntitySystem
}
}
/// <summary>
/// DoAfter event for putting an entity on a meat spike.
/// </summary>
[Serializable, NetSerializable]
public sealed partial class SpikeHookDoAfterEvent : SimpleDoAfterEvent;
/// <summary>
/// DoAfter event for removing an entity from a meat spike.
/// </summary>
[Serializable, NetSerializable]
public sealed partial class SpikeUnhookDoAfterEvent : SimpleDoAfterEvent;
/// <summary>
/// DoAfter event for slicing an entity on a meat spike.
/// </summary>
[Serializable, NetSerializable]
public sealed partial class SpikeButcherDoAfterEvent : SimpleDoAfterEvent;