Files
tbd-station-14/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs
DrSmugleaf 74943a2770 Typo, redundant string interpolation, namespaces and imports cleanup (#2068)
* Readonly, typos and redundant string interpolations

* Namespaces

* Optimize imports

* Address reviews

* but actually

* Localize missing strings

* Remove redundant vars
2020-09-13 14:23:52 +02:00

23 lines
741 B
C#

using Content.Server.GameObjects.Components.GUI;
using Content.Server.GameObjects.Components.Items.Clothing;
using Content.Shared.GameObjects.Components.Inventory;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Mobs
{
[RegisterComponent]
public class HeatResistanceComponent : Component
{
public override string Name => "HeatResistance";
public int GetHeatResistance()
{
if (Owner.GetComponent<InventoryComponent>().TryGetSlotItem(EquipmentSlotDefines.Slots.GLOVES, itemComponent: out ClothingComponent gloves))
{
return gloves?.HeatResistance ?? int.MinValue;
}
return int.MinValue;
}
}
}