PalacePal/Pal.Client/Rendering/MarkerConfig.cs

21 lines
748 B
C#
Raw Normal View History

2023-02-08 15:06:43 +00:00
using System.Collections.Generic;
namespace Pal.Client.Rendering
{
internal class MarkerConfig
{
2023-02-11 20:10:45 +00:00
private static readonly MarkerConfig EmptyConfig = new();
private static readonly Dictionary<Marker.EType, MarkerConfig> MarkerConfigs = new()
2023-02-08 15:06:43 +00:00
{
{ Marker.EType.Trap, new MarkerConfig { Radius = 1.7f } },
{ Marker.EType.Hoard, new MarkerConfig { Radius = 1.7f, OffsetY = -0.03f } },
{ Marker.EType.SilverCoffer, new MarkerConfig { Radius = 1f } },
};
2023-02-11 20:10:45 +00:00
public float OffsetY { get; set; }
2023-02-08 15:06:43 +00:00
public float Radius { get; set; } = 0.25f;
2023-02-11 20:10:45 +00:00
public static MarkerConfig ForType(Marker.EType type) => MarkerConfigs.GetValueOrDefault(type, EmptyConfig);
2023-02-08 15:06:43 +00:00
}
}