Files
tbd-station-14/Content.Server/AI/WorldState/States/Hands/FreeHands.cs
DrSmugleaf 4a8ed41e3a Fix namespaces and optimize imports (#1651)
* Fix namespaces and optimize imports

* Cleanup fixes

* Merge conflict fixes

* Merge conflict fixes

* Merge conflict fixes
2020-08-13 14:40:27 +02:00

33 lines
828 B
C#

using System.Collections.Generic;
using Content.Server.GameObjects.Components.GUI;
using JetBrains.Annotations;
namespace Content.Server.AI.WorldState.States.Hands
{
[UsedImplicitly]
public sealed class FreeHands : StateData<List<string>>
{
public override string Name => "FreeHands";
public override List<string> GetValue()
{
var result = new List<string>();
if (!Owner.TryGetComponent(out HandsComponent handsComponent))
{
return result;
}
foreach (var hand in handsComponent.ActivePriorityEnumerable())
{
if (handsComponent.GetItem(hand) == null)
{
result.Add(hand);
}
}
return result;
}
}
}