Snowflake/RPG.Services.Core/Options/ServiceNodeOptions.cs

18 lines
491 B
C#
Raw Permalink Normal View History

2024-01-18 22:13:40 +00:00
using RPG.Network.Proto;
namespace RPG.Services.Core.Options;
public class ServiceNodeOptions : List<ServiceNodeOptions.Entry>
{
public class Entry
{
public required RPGServiceType Type { get; set; }
public required string Host { get; set; }
public required int Port { get; set; }
}
public Entry GetEntry(RPGServiceType type)
{
return Find(e => e.Type == type) ?? throw new ArgumentException("Entry not found", nameof(type));
}
}