Files
crystall-punk-14/Content.Shared/MobState/MobStateChangedEvent.cs

53 lines
1.5 KiB
C#
Raw Normal View History

2021-11-08 15:11:58 +01:00
using Content.Shared.MobState.Components;
2021-06-09 22:19:39 +02:00
namespace Content.Shared.MobState
{
public sealed class MobStateChangedEvent : EntityEventArgs
{
2021-12-05 14:08:35 +11:00
public MobStateChangedEvent(
2021-11-08 15:11:58 +01:00
MobStateComponent component,
2022-07-06 17:58:14 +10:00
DamageState? oldMobState,
DamageState currentMobState)
{
Component = component;
OldMobState = oldMobState;
CurrentMobState = currentMobState;
}
2021-12-04 12:59:44 +01:00
public EntityUid Entity => Component.Owner;
2021-11-08 15:11:58 +01:00
public MobStateComponent Component { get; }
2022-07-06 17:58:14 +10:00
public DamageState? OldMobState { get; }
2022-07-06 17:58:14 +10:00
public DamageState CurrentMobState { get; }
}
public static class A
{
[Obsolete("Just check for the enum value instead")]
public static bool IsAlive(this DamageState state)
{
return state == DamageState.Alive;
}
[Obsolete("Just check for the enum value instead")]
public static bool IsCritical(this DamageState state)
{
return state == DamageState.Critical;
}
[Obsolete("Just check for the enum value instead")]
public static bool IsDead(this DamageState state)
{
return state == DamageState.Dead;
}
[Obsolete("Just check for the enum value instead")]
public static bool IsIncapacitated(this DamageState state)
{
return state is DamageState.Dead or DamageState.Critical;
}
}
}