mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
17 lines
561 B
C#
17 lines
561 B
C#
using System.Reflection;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace Bounce.Resources;
|
|
|
|
internal static class Resource
|
|
{
|
|
internal static class Streams
|
|
{
|
|
public static Stream Instructions => GetStream();
|
|
public static Stream Title => GetStream();
|
|
}
|
|
|
|
private static Stream GetStream([CallerMemberName] string? name = null)
|
|
=> Assembly.GetExecutingAssembly().GetManifestResourceStream($"Bounce.Resources.{name}.txt")
|
|
?? throw new ArgumentException($"Resource stream {name} does not exist", nameof(name));
|
|
} |