KafkaSR/RPG.Services.Core/Options/ServiceNodeOptions.cs
2024-01-30 02:49:21 +03:00

17 lines
491 B
C#

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));
}
}