mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-23 07:29:02 -08:00
Fix some resource issues
This commit is contained in:
@@ -15,11 +15,11 @@ internal class Game
|
|||||||
|
|
||||||
public void Play()
|
public void Play()
|
||||||
{
|
{
|
||||||
_io.WriteLine(Resource.Streams.Introduction);
|
_io.Write(Resource.Streams.Introduction);
|
||||||
var response = _io.ReadString("Do you want instructions");
|
var response = _io.ReadString("Do you want instructions");
|
||||||
if (!response.Equals("no", StringComparison.InvariantCultureIgnoreCase))
|
if (!response.Equals("no", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
_io.WriteLine(Resource.Streams.Instructions);
|
_io.Write(Resource.Streams.Instructions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,3 +5,4 @@
|
|||||||
|
|
||||||
The Game Bug
|
The Game Bug
|
||||||
I hope you enjoy this game.
|
I hope you enjoy this game.
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ internal static class Resource
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Stream GetStream([CallerMemberName] string? name = null) =>
|
private static Stream GetStream([CallerMemberName] string? name = null) =>
|
||||||
Assembly.GetExecutingAssembly().GetManifestResourceStream($"Basketball.Resources.{name}.txt")
|
Assembly.GetExecutingAssembly()
|
||||||
|
.GetManifestResourceStream($"{typeof(Resource).Namespace}.{name}.txt")
|
||||||
?? throw new Exception($"Could not find embedded resource stream '{name}'.");
|
?? throw new Exception($"Could not find embedded resource stream '{name}'.");
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user