2021-09-10 17:57:24 +01:00
|
|
|
|
using AssortValidator.Common.Models;
|
2022-01-12 15:04:42 +00:00
|
|
|
|
using System;
|
2021-09-10 17:57:24 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace AssortValidator.Common.Helpers
|
|
|
|
|
{
|
|
|
|
|
public static class TraderHelper
|
|
|
|
|
{
|
|
|
|
|
private static Dictionary<Trader, string> _traders;
|
|
|
|
|
|
|
|
|
|
public static Dictionary<Trader, string> GetTraders()
|
|
|
|
|
{
|
|
|
|
|
if (_traders == null)
|
|
|
|
|
{
|
|
|
|
|
_traders = new Dictionary<Trader, string>
|
|
|
|
|
{
|
|
|
|
|
{ Trader.Prapor, "54cb50c76803fa8b248b4571" },
|
|
|
|
|
{ Trader.Therapist, "54cb57776803fa99248b456e"},
|
|
|
|
|
{ Trader.Skier, "58330581ace78e27b8b10cee"},
|
|
|
|
|
{ Trader.Peacekeeper, "5935c25fb3acc3127c3d8cd9"},
|
|
|
|
|
{ Trader.Mechanic, "5a7c2eca46aef81a7ca2145d"},
|
|
|
|
|
{ Trader.Ragman, "5ac3b934156ae10c4430e83c"},
|
|
|
|
|
{ Trader.Jaeger, "5c0647fdd443bc2504c2d371"}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _traders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Trader GetTraderTypeById(string traderId)
|
|
|
|
|
{
|
|
|
|
|
Trader returnType = 0;
|
|
|
|
|
foreach (var item in GetTraders())
|
|
|
|
|
{
|
|
|
|
|
if (item.Value == traderId)
|
|
|
|
|
{
|
|
|
|
|
returnType = item.Key;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return returnType;
|
|
|
|
|
}
|
2022-01-12 15:04:42 +00:00
|
|
|
|
|
|
|
|
|
public static string GetTraderIdByName(Trader key)
|
|
|
|
|
{
|
|
|
|
|
return _traders.GetValueOrDefault(key, string.Empty);
|
|
|
|
|
}
|
2021-09-10 17:57:24 +01:00
|
|
|
|
}
|
|
|
|
|
}
|