Re-organize all projects (#4166)
This commit is contained in:
55
Content.Shared/Interaction/IUse.cs
Normal file
55
Content.Shared/Interaction/IUse.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Analyzers;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Shared.Interaction
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface gives components behavior when using the entity in your active hand
|
||||
/// (done by clicking the entity in the active hand or pressing the keybind that defaults to Z).
|
||||
/// </summary>
|
||||
[RequiresExplicitImplementation]
|
||||
public interface IUse
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when we activate an object we are holding to use it
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[Obsolete("Use UseInHandMessage instead")]
|
||||
bool UseEntity(UseEntityEventArgs eventArgs);
|
||||
}
|
||||
|
||||
public class UseEntityEventArgs : EventArgs
|
||||
{
|
||||
public UseEntityEventArgs(IEntity user)
|
||||
{
|
||||
User = user;
|
||||
}
|
||||
|
||||
public IEntity User { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised when using the entity in your hands.
|
||||
/// </summary>
|
||||
[PublicAPI]
|
||||
public class UseInHandEvent : HandledEntityEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity holding the item in their hand.
|
||||
/// </summary>
|
||||
public IEntity User { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Item that was used.
|
||||
/// </summary>
|
||||
public IEntity Used { get; }
|
||||
|
||||
public UseInHandEvent(IEntity user, IEntity used)
|
||||
{
|
||||
User = user;
|
||||
Used = used;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user