24 lines
607 B
C#
24 lines
607 B
C#
namespace SpaceGame.Api.Universe.Scenario;
|
|
|
|
internal static class SystemSelectionPolicy
|
|
{
|
|
internal static readonly string[] PreferredSystemIds =
|
|
[
|
|
"sol",
|
|
"helios",
|
|
];
|
|
|
|
internal static string SelectFallbackSystemId(IReadOnlyList<string> availableSystemIds)
|
|
{
|
|
foreach (var preferredSystemId in PreferredSystemIds)
|
|
{
|
|
if (availableSystemIds.Contains(preferredSystemId, StringComparer.Ordinal))
|
|
{
|
|
return preferredSystemId;
|
|
}
|
|
}
|
|
|
|
return availableSystemIds.FirstOrDefault() ?? string.Empty;
|
|
}
|
|
}
|