Re-organize all projects (#4166)

This commit is contained in:
DrSmugleaf
2021-06-09 22:19:39 +02:00
committed by GitHub
parent 9f50e4061b
commit ff1a2d97ea
1773 changed files with 5258 additions and 5508 deletions

View File

@@ -0,0 +1,46 @@
#nullable enable
using System;
using Content.Shared.Actions.Components;
using Robust.Shared.GameObjects;
namespace Content.Shared.Actions.Behaviors
{
/// <summary>
/// Currently just a marker interface delineating the different possible
/// types of action behaviors.
/// </summary>
public interface IActionBehavior
{
}
/// <summary>
/// Base class for all action event args
/// </summary>
public abstract class ActionEventArgs : EventArgs
{
/// <summary>
/// Entity performing the action.
/// </summary>
public readonly IEntity Performer;
/// <summary>
/// Action being performed
/// </summary>
public readonly ActionType ActionType;
/// <summary>
/// Actions component of the performer.
/// </summary>
public readonly SharedActionsComponent? PerformerActions;
public ActionEventArgs(IEntity performer, ActionType actionType)
{
Performer = performer;
ActionType = actionType;
if (!Performer.TryGetComponent(out PerformerActions))
{
throw new InvalidOperationException($"performer {performer.Name} tried to perform action {actionType} " +
$" but the performer had no actions component," +
" which should never occur");
}
}
}
}