Files
crystall-punk-14/Content.Shared/GameObjects/Components/Mobs/DamageStateHelpers.cs

27 lines
742 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
namespace Content.Shared.GameObjects.Components.Mobs
{
public static class DamageStateHelpers
{
/// <summary>
/// Enumerates over <see cref="DamageState"/>, returning them in order
/// of alive to dead.
/// </summary>
/// <returns>An enumerable of <see cref="DamageState"/>.</returns>
public static IEnumerable<DamageState> AliveToDead()
{
foreach (DamageState state in Enum.GetValues(typeof(DamageState)))
{
if (state == DamageState.Invalid)
{
continue;
}
yield return state;
}
}
}
}