Files
tbd-station-14/Content.Server/AI/Utility/Considerations/Clothing/ClothingInSlotCon.cs
metalgearsloth 5391d3c72a Add utility AI (#806)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-06-18 14:52:44 +02:00

25 lines
736 B
C#

using Content.Server.AI.Utility.Curves;
using Content.Server.AI.WorldState;
using Content.Server.AI.WorldState.States.Clothing;
using Content.Shared.GameObjects.Components.Inventory;
namespace Content.Server.AI.Utility.Considerations.Clothing
{
public class ClothingInSlotCon : Consideration
{
private EquipmentSlotDefines.Slots _slot;
public ClothingInSlotCon(EquipmentSlotDefines.Slots slot, IResponseCurve curve) : base(curve)
{
_slot = slot;
}
public override float GetScore(Blackboard context)
{
var inventory = context.GetState<EquippedClothingState>().GetValue();
return inventory.ContainsKey(_slot) ? 1.0f : 0.0f;
}
}
}