mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Axes the easy IMapManager references * Axes the references to unported (obsolete) IMapManager methods * Converts salvageruler command to a LocalizedEntityCommand so it can use SharedMapSystem * Removes IMapManager from GameTicker This required axing the map nuke during restart, but that should be fine? Maps are entities so EntityManager.FlushEntities should delete them all and that's the preceding line * submodule update(?) --------- Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using System.Linq;
|
|
using Content.Shared.Construction.Components;
|
|
using Robust.Shared.Map;
|
|
using static Content.Shared.Interaction.SharedInteractionSystem;
|
|
|
|
namespace Content.Shared.Construction
|
|
{
|
|
public abstract partial class SharedConstructionSystem : EntitySystem
|
|
{
|
|
[Dependency] private SharedMapSystem _map = default!;
|
|
[Dependency] protected SharedTransformSystem TransformSystem = default!;
|
|
|
|
/// <summary>
|
|
/// Get predicate for construction obstruction checks.
|
|
/// </summary>
|
|
public Ignored? GetPredicate(bool canBuildInImpassable, MapCoordinates coords)
|
|
{
|
|
if (!canBuildInImpassable)
|
|
return null;
|
|
|
|
if (!_map.TryFindGridAt(coords, out var gridUid, out var grid))
|
|
return null;
|
|
|
|
var ignored = _map.GetAnchoredEntities((gridUid, grid), 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 ProtoMan.Index(info.DefaultPrototype).Name;
|
|
}
|
|
}
|
|
}
|