mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-06-26 16:33:56 -07:00
Add title
This commit is contained in:
@@ -2,7 +2,6 @@ namespace Poetry;
|
||||
|
||||
internal static class IOExtensions
|
||||
{
|
||||
|
||||
internal static void WritePhrase(this IReadWrite io, Context context)
|
||||
=> Phrase.GetPhrase(context).Write(io, context);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
using static Poetry.Resources.Resource;
|
||||
|
||||
namespace Poetry;
|
||||
|
||||
internal class Poem
|
||||
{
|
||||
internal static void Compose(IReadWrite io, IRandom random)
|
||||
{
|
||||
io.Write(Streams.Title);
|
||||
|
||||
var context = new Context();
|
||||
|
||||
while (true)
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources/*.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\00_Common\dotnet\Games.Common\Games.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Poetry.Resources;
|
||||
|
||||
internal static class Resource
|
||||
{
|
||||
internal static class Streams
|
||||
{
|
||||
public static Stream Title => GetStream();
|
||||
}
|
||||
|
||||
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}'.");
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
Poetry
|
||||
Creative Computing Morristown, New Jersey
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user