mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
Add Program and Game class
This commit is contained in:
18
30_Cube/csharp/Game.cs
Normal file
18
30_Cube/csharp/Game.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
namespace Cube;
|
||||||
|
|
||||||
|
internal class Game
|
||||||
|
{
|
||||||
|
private readonly IReadWrite _io;
|
||||||
|
private readonly IRandom _random;
|
||||||
|
|
||||||
|
public Game(IReadWrite io, IRandom random)
|
||||||
|
{
|
||||||
|
_io = io;
|
||||||
|
_random = random;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Play()
|
||||||
|
{
|
||||||
|
_io.Write(Streams.Introduction);
|
||||||
|
}
|
||||||
|
}
|
||||||
8
30_Cube/csharp/Program.cs
Normal file
8
30_Cube/csharp/Program.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
global using Games.Common.IO;
|
||||||
|
global using Games.Common.Randomness;
|
||||||
|
|
||||||
|
global using static Cube.Resources.Resource;
|
||||||
|
|
||||||
|
using Cube;
|
||||||
|
|
||||||
|
new Game(new ConsoleIO(), new RandomNumberGenerator()).Play();
|
||||||
Reference in New Issue
Block a user