Add a map renderer (#3613)

Co-authored-by: github-actions <github-actions@users.noreply.github.com>
This commit is contained in:
Javier Guardia Fernández
2022-01-07 18:54:06 +01:00
committed by GitHub
parent 4b732dda8f
commit c30c8020e8
11 changed files with 696 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#nullable enable
using System;
using System.Diagnostics.CodeAnalysis;
namespace Content.MapRenderer.Extensions
{
public static class EnvironmentExtensions
{
public static bool TryGetVariable(string key, [NotNullWhen(true)] out string? value)
{
return (value = Environment.GetEnvironmentVariable(key)) != null;
}
public static string GetVariableOrThrow(string key)
{
return Environment.GetEnvironmentVariable(key) ??
throw new ArgumentException($"No environment variable found with key {key}");
}
}
}