Re-organize all projects (#4166)
This commit is contained in:
27
Content.Shared/MobState/DamageStateHelpers.cs
Normal file
27
Content.Shared/MobState/DamageStateHelpers.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Content.Shared.MobState
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user