2022-05-03 01:43:25 +03:00
|
|
|
|
namespace Content.Shared.Destructible;
|
|
|
|
|
|
|
|
|
|
|
|
public abstract class SharedDestructibleSystem : EntitySystem
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Force entity to be destroyed and deleted.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void DestroyEntity(EntityUid owner)
|
|
|
|
|
|
{
|
|
|
|
|
|
var eventArgs = new DestructionEventArgs();
|
|
|
|
|
|
|
2023-05-11 23:19:08 +10:00
|
|
|
|
RaiseLocalEvent(owner, eventArgs);
|
2022-05-03 01:43:25 +03:00
|
|
|
|
QueueDel(owner);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-01-23 17:59:09 -05:00
|
|
|
|
/// Force entity to break.
|
2022-05-03 01:43:25 +03:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void BreakEntity(EntityUid owner)
|
|
|
|
|
|
{
|
|
|
|
|
|
var eventArgs = new BreakageEventArgs();
|
2023-05-11 23:19:08 +10:00
|
|
|
|
RaiseLocalEvent(owner, eventArgs);
|
2022-05-03 01:43:25 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raised when entity is destroyed and about to be deleted.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public sealed class DestructionEventArgs : EntityEventArgs
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Raised when entity was heavy damage and about to break.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public sealed class BreakageEventArgs : EntityEventArgs
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|