Files
tbd-station-14/Content.Server/GameObjects/EntitySystems/WireHackingSystem.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

54 lines
1.4 KiB
C#

using System.Collections.Generic;
using Content.Shared.GameTicking;
using Robust.Shared.GameObjects;
using Robust.Shared.ViewVariables;
using static Content.Shared.GameObjects.Components.SharedWiresComponent;
namespace Content.Server.GameObjects.EntitySystems
{
public class WireHackingSystem : EntitySystem, IResettingEntitySystem
{
[ViewVariables] private readonly Dictionary<string, WireLayout> _layouts =
new();
public bool TryGetLayout(string id, out WireLayout layout)
{
return _layouts.TryGetValue(id, out layout);
}
public void AddLayout(string id, WireLayout layout)
{
_layouts.Add(id, layout);
}
public void Reset()
{
_layouts.Clear();
}
}
public sealed class WireLayout
{
[ViewVariables] public IReadOnlyDictionary<object, WireData> Specifications { get; }
public WireLayout(IReadOnlyDictionary<object, WireData> specifications)
{
Specifications = specifications;
}
public sealed class WireData
{
public WireLetter Letter { get; }
public WireColor Color { get; }
public int Position { get; }
public WireData(WireLetter letter, WireColor color, int position)
{
Letter = letter;
Color = color;
Position = position;
}
}
}
}