Files
crystall-punk-14/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs

37 lines
993 B
C#
Raw Normal View History

2017-09-30 16:56:19 +02:00
using Content.Server.Interfaces.GameObjects;
using SS14.Server.Interfaces.GameObjects;
2017-09-24 21:09:26 +02:00
using System;
using SS14.Shared.Interfaces.GameObjects;
2017-09-24 21:09:26 +02:00
namespace Content.Server.GameObjects
2017-09-24 21:09:26 +02:00
{
public class ItemComponent : StoreableComponent, EntitySystems.IAttackHand
2017-09-24 21:09:26 +02:00
{
public override string Name => "Item";
2017-09-24 21:09:26 +02:00
public void RemovedFromSlot()
{
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
2017-09-30 16:56:19 +02:00
{
component.Visible = true;
}
2017-09-24 21:09:26 +02:00
}
public void EquippedToSlot()
2017-09-24 21:09:26 +02:00
{
foreach (var component in Owner.GetAllComponents<ISpriteRenderableComponent>())
2017-09-30 16:56:19 +02:00
{
component.Visible = false;
}
2017-09-24 21:09:26 +02:00
}
public bool Attackhand(IEntity user)
{
var hands = user.GetComponent<IHandsComponent>();
hands.PutInHand(this, hands.ActiveIndex, fallback: false);
return true;
}
2017-09-24 21:09:26 +02:00
}
}