diff --git a/16_Bug/csharp/Bug.csproj b/16_Bug/csharp/Bug.csproj index d3fe4757..91e759c0 100644 --- a/16_Bug/csharp/Bug.csproj +++ b/16_Bug/csharp/Bug.csproj @@ -6,4 +6,13 @@ enable enable + + + + + + + + + diff --git a/16_Bug/csharp/Resources/Introduction.txt b/16_Bug/csharp/Resources/Introduction.txt new file mode 100644 index 00000000..b49238e6 --- /dev/null +++ b/16_Bug/csharp/Resources/Introduction.txt @@ -0,0 +1,7 @@ + Bug + Creative Computing Morristown, New Jersey + + + +The Game Bug +I hope you enjoy this game. diff --git a/16_Bug/csharp/Resources/Intructions.txt b/16_Bug/csharp/Resources/Intructions.txt new file mode 100644 index 00000000..bdbdadd3 --- /dev/null +++ b/16_Bug/csharp/Resources/Intructions.txt @@ -0,0 +1,18 @@ +The object of Bug is to finish your bug before I finish +mine. Each number stands for a part of the bug body. +I will roll the die for you, tell you what I rolled for you +what the number stands for, and if you can get the part. +If you can get the part I will give it to you. +The same will happen on my turn. +If there is a change in either bug I will give you the +option of seeing the pictures of the bugs. +The numbers stand for parts as follows: +Number Part Number of part needed + 1 Body 1 + 2 Neck 1 + 3 Head 1 + 4 Feelers 2 + 5 Tail 1 + 6 Legs 6 + + diff --git a/16_Bug/csharp/Resources/Resource.cs b/16_Bug/csharp/Resources/Resource.cs new file mode 100644 index 00000000..165b9c82 --- /dev/null +++ b/16_Bug/csharp/Resources/Resource.cs @@ -0,0 +1,24 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace Bug.Resources; + +internal static class Resource +{ + internal static class Streams + { + public static Stream Introduction => GetStream(); + public static Stream Instructions => GetStream(); + } + + 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($"Basketball.Resources.{name}.txt") + ?? throw new Exception($"Could not find embedded resource stream '{name}'."); +} \ No newline at end of file