Pick up verb.

This commit is contained in:
Pieter-Jan Briers
2019-03-26 13:46:07 +01:00
parent 38d11d0684
commit de26699cfe

View File

@@ -1,6 +1,6 @@
using Content.Server.Interfaces.GameObjects;
using SS14.Server.Interfaces.GameObjects;
using System;
using Content.Shared.GameObjects;
using SS14.Shared.Interfaces.GameObjects;
namespace Content.Server.GameObjects
@@ -32,5 +32,27 @@ namespace Content.Server.GameObjects
hands.PutInHand(this, hands.ActiveIndex, fallback: false);
return true;
}
[Verb]
public sealed class PickUpVerb : Verb<ItemComponent>
{
protected override string GetText(IEntity user, ItemComponent component)
{
return "Pick Up";
}
protected override bool IsDisabled(IEntity user, ItemComponent component)
{
return false;
}
protected override void Activate(IEntity user, ItemComponent component)
{
if (user.TryGetComponent(out HandsComponent hands))
{
hands.PutInHand(component);
}
}
}
}
}