mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-21 23:00:43 -08:00
19 lines
624 B
C#
19 lines
624 B
C#
using System.Reflection;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace BugGame.Resources;
|
|
|
|
internal static class Resource
|
|
{
|
|
internal static class Streams
|
|
{
|
|
public static Stream Introduction => GetStream();
|
|
public static Stream Instructions => GetStream();
|
|
public static Stream PlayAgain => GetStream();
|
|
}
|
|
|
|
private static Stream GetStream([CallerMemberName] string? name = null) =>
|
|
Assembly.GetExecutingAssembly()
|
|
.GetManifestResourceStream($"Bug.Resources.{name}.txt")
|
|
?? throw new Exception($"Could not find embedded resource stream '{name}'.");
|
|
} |