Literally Murder IExamine (#7352)

This commit is contained in:
Rane
2022-04-08 17:17:25 -04:00
committed by GitHub
parent 427f7378c3
commit 7900abb888
27 changed files with 372 additions and 469 deletions

View File

@@ -1,34 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Shared.DragDrop;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Helpers;
using Content.Shared.MobState.Components;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Utility;
using static Content.Shared.Interaction.SharedInteractionSystem;
namespace Content.Shared.Examine
{
[Obsolete("Use ExaminedEvent instead.")]
public interface IExamine
{
/// <summary>
/// Returns a status examine value for components appended to the end of the description of the entity
/// </summary>
/// <param name="message">The message to append to which will be displayed.</param>
/// <param name="inDetailsRange">Whether the examiner is within the 'Details' range, allowing you to show information logically only availabe when close to the examined entity.</param>
void Examine(FormattedMessage message, bool inDetailsRange);
}
public abstract class ExamineSystemShared : EntitySystem
{
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
@@ -269,21 +251,6 @@ namespace Content.Shared.Examine
var examinedEvent = new ExaminedEvent(message, entity, examiner.Value, isInDetailsRange, doNewline);
RaiseLocalEvent(entity, examinedEvent);
//Add component statuses from components that report one
foreach (var examineComponent in EntityManager.GetComponents<IExamine>(entity))
{
var subMessage = new FormattedMessage();
examineComponent.Examine(subMessage, isInDetailsRange);
if (subMessage.Tags.Count == 0)
continue;
if (doNewline)
message.AddText("\n");
message.AddMessage(subMessage);
doNewline = true;
}
message.Pop();
return message;