PKHeX/PKHeX.Core/Game/GameStrings/LocationSet/LocationSet0.cs
Kurt d47bb1d297
Update .NET Runtime to .NET 8.0 (#4082)
With the new version of Visual Studio bringing C# 12, we can revise our logic for better readability as well as use new methods/APIs introduced in the .NET 8.0 BCL.
2023-12-03 20:13:20 -08:00

26 lines
546 B
C#

using System;
using System.Collections.Generic;
namespace PKHeX.Core;
public sealed record LocationSet0(string[] Met0) : ILocationSet
{
public ReadOnlySpan<string> GetLocationNames(int bankID) => bankID switch
{
0 => Met0,
_ => [],
};
public string GetLocationName(int locationID)
{
if ((uint)locationID >= Met0.Length)
return string.Empty;
return Met0[locationID];
}
public IEnumerable<(int Bank, string[] Names)> GetAll()
{
yield return (0, Met0);
}
}