Files
RobustToolbox/Robust.Shared/GameObjects/ComponentEventArgs.cs
T
Tyler YoungandGitHub 4650dc2c49 ComponentManager Rework (#1143)
* rework ComponentManager

create indexing solution, UniqueIndex

split out ComponentEventArgs, add sealed variants

fix up documentation

fix terrible crap

make benchmark work

* woops, ordered enumerables are already a copy

* naming

* clean up comments

* nullable enable

* add some doc comments to unique index

* perf tweaks

add UniqueIndexHkm for high key mutability

extract internal interface mostly for documentation

add nullability support and constraints

* fix doc comment for UniqueIndexHkm

* make PVS threaded

* remove redundant member declarations in interface

* fix grid loss crap on client shutdown

* fix nullability warning when retrieving from always constructed threadlocal

* add comment explaining chan == null check

remove inParallel parameter
2020-06-24 11:59:56 +02:00

64 lines
2.0 KiB
C#

#nullable enable
using System;
using Robust.Shared.Interfaces.GameObjects;
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) { }
}
}