Machine-code cleanup (#28489)

This commit is contained in:
Nemanja
2024-06-05 16:23:23 -04:00
committed by GitHub
parent 8a7b0f675e
commit 729e67af7f
31 changed files with 350 additions and 979 deletions

View File

@@ -1,5 +1,7 @@
using System.Linq;
using Content.Shared.Construction.Components;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using static Content.Shared.Interaction.SharedInteractionSystem;
namespace Content.Shared.Construction
@@ -7,6 +9,7 @@ namespace Content.Shared.Construction
public abstract class SharedConstructionSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
/// <summary>
/// Get predicate for construction obstruction checks.
@@ -22,5 +25,13 @@ namespace Content.Shared.Construction
var ignored = grid.GetAnchoredEntities(coords).ToHashSet();
return e => ignored.Contains(e);
}
public string GetExamineName(GenericPartInfo info)
{
if (info.ExamineName is not null)
return Loc.GetString(info.ExamineName.Value);
return PrototypeManager.Index(info.DefaultPrototype).Name;
}
}
}