Update documentation for body system code (#2556)

This commit is contained in:
DrSmugleaf
2020-11-15 04:22:59 +01:00
committed by GitHub
parent b1a7aef97d
commit 6549961a02
25 changed files with 271 additions and 87 deletions

View File

@@ -94,7 +94,7 @@ namespace Content.Shared.GameObjects.Components.Body.Surgery
return null;
}
public override string GetDescription(IEntity target)
public override string GetDescription()
{
if (Parent == null)
{
@@ -107,21 +107,21 @@ namespace Content.Shared.GameObjects.Components.Body.Surgery
{
// Case: skin is opened, but not clamped.
toReturn += Loc.GetString("The skin on {0:their} {1} has an incision, but it is prone to bleeding.\n",
target, Parent.Name);
Owner, Parent.Name);
}
else if (_skinOpened && _vesselsClamped && !_skinRetracted)
{
// Case: skin is opened and clamped, but not retracted.
toReturn += Loc.GetString("The skin on {0:their} {1} has an incision, but it is not retracted.\n",
target, Parent.Name);
Owner, Parent.Name);
}
else if (_skinOpened && _vesselsClamped && _skinRetracted)
{
// Case: skin is fully open.
toReturn += Loc.GetString("There is an incision on {0:their} {1}.\n", target, Parent.Name);
toReturn += Loc.GetString("There is an incision on {0:their} {1}.\n", Owner, Parent.Name);
foreach (var mechanism in _disconnectedOrgans)
{
toReturn += Loc.GetString("{0:their} {1} is loose.\n", target, mechanism.Name);
toReturn += Loc.GetString("{0:their} {1} is loose.\n", Owner, mechanism.Name);
}
}

View File

@@ -6,9 +6,8 @@ using Robust.Shared.Interfaces.GameObjects;
namespace Content.Shared.GameObjects.Components.Body.Surgery
{
/// <summary>
/// Interface representing an entity capable of performing surgery (performing operations on an
/// <see cref="SurgeryDataComponent"/> class).
/// For an example see <see cref="SurgeryToolComponent"/>, which inherits from this class.
/// Interface representing an entity capable of performing surgery,
/// such as a circular saw.
/// </summary>
public interface ISurgeon
{
@@ -19,15 +18,16 @@ namespace Content.Shared.GameObjects.Components.Body.Surgery
IEntity performer);
/// <summary>
/// How long it takes to perform a single surgery step (in seconds).
/// How long it takes to perform a single surgery step in seconds.
/// </summary>
public float BaseOperationTime { get; set; }
/// <summary>
/// When performing a surgery, the <see cref="SurgeryDataComponent"/> may sometimes require selecting from a set of Mechanisms
/// to operate on.
/// This function is called in that scenario, and it is expected that you call the callback with one mechanism from the
/// provided list.
/// When performing a surgery, the <see cref="SurgeryDataComponent"/>
/// may sometimes require selecting from a set of
/// <see cref="IMechanism"/>s to operate on.
/// This function is called in that scenario, and it is expected that you call
/// the callback with one <see cref="IMechanism"/> from the provided list.
/// </summary>
public void RequestMechanism(IEnumerable<IMechanism> options, MechanismRequestCallback callback);
}

View File

@@ -3,14 +3,11 @@ using Content.Shared.GameObjects.Components.Body.Mechanism;
using Content.Shared.GameObjects.Components.Body.Part;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Body.Surgery
{
/// <summary>
/// This data class represents the state of a <see cref="IBodyPart"/> in
/// regards to everything surgery related - whether there's an incision on
/// it, whether the bone is broken, etc.
/// Represents the current surgery state of a <see cref="IBodyPart"/>.
/// </summary>
public abstract class SurgeryDataComponent : Component
{
@@ -29,10 +26,10 @@ namespace Content.Shared.GameObjects.Components.Body.Surgery
protected BodyPartType? ParentType => Parent?.PartType;
/// <summary>
/// Returns the description of this current <see cref="IBodyPart"/> to
/// be shown upon observing the given entity.
/// Returns a description of this entity.
/// </summary>
public abstract string GetDescription(IEntity target);
/// <returns>The description shown upon observing this entity.</returns>
public abstract string GetDescription();
/// <summary>
/// Returns whether a <see cref="IMechanism"/> can be added into the

View File

@@ -4,8 +4,9 @@ using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Body.Surgery
{
/// <summary>
/// Defines a surgery operation that can be performed.
/// Types of surgery operations that can be performed.
/// </summary>
// TODO BODY Move this to YAML?
[Serializable, NetSerializable]
public enum SurgeryType
{