Files
RobustToolbox/Robust.Shared/GameObjects/ComponentEventArgs.cs
T
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00

63 lines
2.0 KiB
C#

#nullable enable
using System;
namespace Robust.Shared.GameObjects
{
/// <summary>
/// Arguments for an event related to a component.
/// </summary>
public abstract class ComponentEventArgs : EventArgs
{
/// <summary>
/// Component that this event relates to.
/// </summary>
public IComponent Component { get; }
/// <summary>
/// Constructs a new instance of <see cref="ComponentEventArgs"/>.
/// </summary>
/// <param name="component">The relevant component</param>
protected ComponentEventArgs(IComponent component) => Component = component;
}
/// <summary>
/// Arguments for an event related to a component being added.
/// </summary>
public sealed class AddedComponentEventArgs : ComponentEventArgs
{
/// <summary>
/// Constructs a new instance of <see cref="AddedComponentEventArgs"/>.
/// </summary>
/// <param name="component">The relevant component</param>
public AddedComponentEventArgs(IComponent component) : base(component) { }
}
/// <summary>
/// Arguments for an event related to a component being removed.
/// </summary>
public sealed class RemovedComponentEventArgs : ComponentEventArgs
{
/// <summary>
/// Constructs a new instance of <see cref="RemovedComponentEventArgs"/>.
/// </summary>
/// <param name="component">The relevant component</param>
public RemovedComponentEventArgs(IComponent component) : base(component) { }
}
/// <summary>
/// Arguments for an event related to a component being deleted.
/// </summary>
public sealed class DeletedComponentEventArgs : ComponentEventArgs
{
/// <summary>
/// Constructs a new instance of <see cref="DeletedComponentEventArgs"/>.
/// </summary>
/// <param name="component">The relevant component</param>
public DeletedComponentEventArgs(IComponent component) : base(component) { }
}
}