Add resources

This commit is contained in:
Andrew Cooper
2022-04-16 22:34:08 +10:00
parent 8dd1180d87
commit c4c67e15a2
4 changed files with 38 additions and 0 deletions

View File

@@ -6,4 +6,12 @@
<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>
</Project>

View File

@@ -0,0 +1,8 @@
This simulation lets you specify the initial velocity
of a ball thrown straight up, and the coefficient of
elasticity of the ball. Please use a decimal fraction
coefficiency (less than 1).
You also specify the time increment to be used in
'strobing' the ball's flight (try .1 initially).

View File

@@ -0,0 +1,17 @@
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));
}

View File

@@ -0,0 +1,5 @@
Bounce
Creative Computing Morristown, New Jersey