diff --git a/56_Life_for_Two/csharp/LifeforTwo.csproj b/56_Life_for_Two/csharp/LifeforTwo.csproj index d3fe4757..3870320c 100644 --- a/56_Life_for_Two/csharp/LifeforTwo.csproj +++ b/56_Life_for_Two/csharp/LifeforTwo.csproj @@ -6,4 +6,12 @@ enable enable + + + + + + + + diff --git a/56_Life_for_Two/csharp/Program.cs b/56_Life_for_Two/csharp/Program.cs new file mode 100644 index 00000000..8261ff82 --- /dev/null +++ b/56_Life_for_Two/csharp/Program.cs @@ -0,0 +1 @@ +global using Games.Common.IO; \ No newline at end of file diff --git a/56_Life_for_Two/csharp/Resources/Resource.cs b/56_Life_for_Two/csharp/Resources/Resource.cs new file mode 100644 index 00000000..60a767bc --- /dev/null +++ b/56_Life_for_Two/csharp/Resources/Resource.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace LifeForTwo.Resources; + +internal static class Resource +{ + internal static class Streams + { + public static Stream Title => GetStream(); + } + + internal static class Formats + { + } + + private static string GetString([CallerMemberName] string? name = null) + { + using var stream = GetStream(name); + using var reader = new StreamReader(stream); + return reader.ReadToEnd(); + } + + private static Stream GetStream([CallerMemberName] string? name = null) => + Assembly.GetExecutingAssembly().GetManifestResourceStream($"{typeof(Resource).Namespace}.{name}.txt") + ?? throw new Exception($"Could not find embedded resource stream '{name}'."); +} \ No newline at end of file diff --git a/56_Life_for_Two/csharp/Resources/Title.txt b/56_Life_for_Two/csharp/Resources/Title.txt new file mode 100644 index 00000000..b9ab3cc6 --- /dev/null +++ b/56_Life_for_Two/csharp/Resources/Title.txt @@ -0,0 +1,5 @@ + Life2 + Creative Computing Morristown, New Jersey + + +