Files
tbd-station-14/Content.Server/Singularity/Components/ContainmentFieldGeneratorComponent.cs
ScalyChimp 9b54a8a2ae ECS containmentfieldgeneratorcomponent (#8757)
* ECS containmentfieldgeneratorcomponent

* Fix tests and clean up one line

* check for anchored in a better way

* Fix dependency exception

I'm not really happy with this solution, it's not very good but I'm not
sure how to do it better without refactoring way more than I want to. Maybe
I'm missing something.

* review

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-06-16 23:46:21 +10:00

28 lines
813 B
C#

using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Physics;
using Content.Shared.Singularity.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Physics;
namespace Content.Server.Singularity.Components
{
[RegisterComponent]
[ComponentReference(typeof(SharedContainmentFieldGeneratorComponent))]
public sealed class ContainmentFieldGeneratorComponent : SharedContainmentFieldGeneratorComponent
{
private int _powerBuffer;
[ViewVariables]
public int PowerBuffer
{
get => _powerBuffer;
set => _powerBuffer = Math.Clamp(value, 0, 6);
}
public Tuple<Direction, ContainmentFieldConnection>? Connection1;
public Tuple<Direction, ContainmentFieldConnection>? Connection2;
}
}