diff --git a/mathGame.rickardwg/DataSource/GameHistoryData.cs b/mathGame.rickardwg/DataSource/GameHistoryData.cs new file mode 100644 index 00000000..ffbd057b --- /dev/null +++ b/mathGame.rickardwg/DataSource/GameHistoryData.cs @@ -0,0 +1,8 @@ +using MathGame.Models; + +namespace MathGame.DataSource; + +internal class GameHistoryData : IGameHistoryData +{ + public List GameHistory { get; set; } = []; +} diff --git a/mathGame.rickardwg/DataSource/IGameHistoryData.cs b/mathGame.rickardwg/DataSource/IGameHistoryData.cs new file mode 100644 index 00000000..6cbecdad --- /dev/null +++ b/mathGame.rickardwg/DataSource/IGameHistoryData.cs @@ -0,0 +1,8 @@ +using MathGame.Models; + +namespace MathGame.DataSource; + +internal interface IGameHistoryData +{ + List GameHistory { get; set; } +} diff --git a/mathGame.rickardwg/Enums/Difficulty.cs b/mathGame.rickardwg/Enums/Difficulty.cs new file mode 100644 index 00000000..7d756872 --- /dev/null +++ b/mathGame.rickardwg/Enums/Difficulty.cs @@ -0,0 +1,8 @@ +namespace MathGame.Enums; + +internal enum Difficulty +{ + Easy, + Medium, + Hard +} diff --git a/mathGame.rickardwg/Enums/GameMode.cs b/mathGame.rickardwg/Enums/GameMode.cs new file mode 100644 index 00000000..a6710074 --- /dev/null +++ b/mathGame.rickardwg/Enums/GameMode.cs @@ -0,0 +1,10 @@ +namespace MathGame.Enums; + +internal enum GameMode +{ + Addition, + Subtraction, + Multiplication, + Division, + Random +} diff --git a/mathGame.rickardwg/Enums/MainMenuOptions.cs b/mathGame.rickardwg/Enums/MainMenuOptions.cs new file mode 100644 index 00000000..c65dff66 --- /dev/null +++ b/mathGame.rickardwg/Enums/MainMenuOptions.cs @@ -0,0 +1,8 @@ +namespace MathGame.Enums; + +internal enum MainMenuOptions +{ + Play, + History, + Exit +} diff --git a/mathGame.rickardwg/Enums/Operation.cs b/mathGame.rickardwg/Enums/Operation.cs new file mode 100644 index 00000000..933d1388 --- /dev/null +++ b/mathGame.rickardwg/Enums/Operation.cs @@ -0,0 +1,9 @@ +namespace MathGame.Enums; + +internal enum Operation +{ + Add, + Subtract, + Multiply, + Divide +} diff --git a/mathGame.rickardwg/Extensions/ServiceCollectionExtensions.cs b/mathGame.rickardwg/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 00000000..697eced3 --- /dev/null +++ b/mathGame.rickardwg/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,27 @@ +using MathGame.DataSource; +using MathGame.Menus; +using MathGame.Repositories; +using MathGame.Services; +using MathGame.Views; +using Microsoft.Extensions.DependencyInjection; + +namespace MathGame.Extensions; + +internal static class ServiceCollectionExtensions +{ + public static IServiceCollection AddCustomServices(this IServiceCollection services) + { + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + services.AddTransient(); + services.AddTransient(); + + services.AddTransient(); + services.AddSingleton(); + + return services; + } +} diff --git a/mathGame.rickardwg/Helpers/ConsoleHelper.cs b/mathGame.rickardwg/Helpers/ConsoleHelper.cs new file mode 100644 index 00000000..f76ca38c --- /dev/null +++ b/mathGame.rickardwg/Helpers/ConsoleHelper.cs @@ -0,0 +1,76 @@ +namespace MathGame.Helpers; + +internal static class ConsoleHelper +{ + internal static T Prompt(string title, params T[] options) + { + ArgumentNullException.ThrowIfNull(options); + + if (options.Length == 0) + { + throw new ArgumentException( + "At least one option must be provided.", + nameof(options)); + } + + Console.CursorVisible = false; + + try + { + var selectedIndex = 0; + while (true) + { + Console.Clear(); + WriteLine(title); + Console.WriteLine(); + + for (int i = 0; i < options.Length; i++) + { + bool isSelected = selectedIndex == i; + string prefix = isSelected ? "> " : " "; + ConsoleColor color = isSelected ? ConsoleColor.Yellow : ConsoleColor.White; + WriteLine($"{prefix}{options[i]}", color); + } + + var keyInfo = Console.ReadKey(true); + + switch (keyInfo.Key) + { + case ConsoleKey.UpArrow: + case ConsoleKey.W: + if (selectedIndex > 0) + { + selectedIndex--; + } + break; + + case ConsoleKey.DownArrow: + case ConsoleKey.S: + if (selectedIndex < options.Length - 1) + { + selectedIndex++; + } + break; + + case ConsoleKey.Enter: return options[selectedIndex]; + } + } + } + finally + { + Console.CursorVisible = true; + } + } + + internal static void WriteLine(string text, ConsoleColor color = ConsoleColor.White) + { + Console.ForegroundColor = color; + Console.WriteLine(text); + } + + internal static void Write(string text, ConsoleColor color = ConsoleColor.White) + { + Console.ForegroundColor = color; + Console.Write(text); + } +} diff --git a/mathGame.rickardwg/MathGame.csproj b/mathGame.rickardwg/MathGame.csproj new file mode 100644 index 00000000..2b24727e --- /dev/null +++ b/mathGame.rickardwg/MathGame.csproj @@ -0,0 +1,14 @@ + + + + Exe + net10.0 + enable + enable + + + + + + + diff --git a/mathGame.rickardwg/Menus/GameMenu.cs b/mathGame.rickardwg/Menus/GameMenu.cs new file mode 100644 index 00000000..a2945f90 --- /dev/null +++ b/mathGame.rickardwg/Menus/GameMenu.cs @@ -0,0 +1,21 @@ +using MathGame.Enums; +using MathGame.Helpers; + +namespace MathGame.Menus; + +internal class GameMenu : IGameMenu +{ + private const string GameModeTitle = "Select Game Mode:"; + private readonly GameMode[] _gameModes = [GameMode.Addition, GameMode.Subtraction, GameMode.Multiplication, GameMode.Division, GameMode.Random]; + private const string DifficultyTitle = "Select Difficulty:"; + private readonly Difficulty[] _difficulties = [Difficulty.Easy, Difficulty.Medium, Difficulty.Hard]; + public GameMode SelectGameMode() + { + return ConsoleHelper.Prompt(GameModeTitle, _gameModes); + } + + public Difficulty SelectDifficulty() + { + return ConsoleHelper.Prompt(DifficultyTitle, _difficulties); + } +} diff --git a/mathGame.rickardwg/Menus/IGameMenu.cs b/mathGame.rickardwg/Menus/IGameMenu.cs new file mode 100644 index 00000000..988c3c55 --- /dev/null +++ b/mathGame.rickardwg/Menus/IGameMenu.cs @@ -0,0 +1,9 @@ +using MathGame.Enums; + +namespace MathGame.Menus; + +internal interface IGameMenu +{ + GameMode SelectGameMode(); + Difficulty SelectDifficulty(); +} diff --git a/mathGame.rickardwg/Menus/IMainMenu.cs b/mathGame.rickardwg/Menus/IMainMenu.cs new file mode 100644 index 00000000..0ec06c5b --- /dev/null +++ b/mathGame.rickardwg/Menus/IMainMenu.cs @@ -0,0 +1,6 @@ +namespace MathGame.Menus; + +internal interface IMainMenu +{ + void Display(); +} diff --git a/mathGame.rickardwg/Menus/MainMenu.cs b/mathGame.rickardwg/Menus/MainMenu.cs new file mode 100644 index 00000000..4db253e7 --- /dev/null +++ b/mathGame.rickardwg/Menus/MainMenu.cs @@ -0,0 +1,40 @@ +using MathGame.Enums; +using MathGame.Helpers; +using MathGame.Views; + +namespace MathGame.Menus; + +internal class MainMenu(IGameMenu gameMenu, IGameView gameView, IGameHistoryView historyView) : IMainMenu +{ + private readonly IGameMenu _gameMenu = gameMenu; + private readonly IGameView _gameView = gameView; + private readonly IGameHistoryView _historyView = historyView; + + private const string Title = "Welcome to The Math Game!"; + private readonly MainMenuOptions[] MenuOptions = [MainMenuOptions.Play, MainMenuOptions.History, MainMenuOptions.Exit]; + public void Display() + { + var exit = false; + while (!exit) + { + Console.Clear(); + var selection = ConsoleHelper.Prompt(Title, MenuOptions); + + switch (selection) + { + case MainMenuOptions.Play: + var gameMode = _gameMenu.SelectGameMode(); + var difficulty = _gameMenu.SelectDifficulty(); + _gameView.DisplayGame(gameMode, difficulty); + break; + + case MainMenuOptions.History: + _historyView.DisplayHistory(); + break; + case MainMenuOptions.Exit: + exit = true; + break; + } + } + } +} diff --git a/mathGame.rickardwg/Models/GameEntry.cs b/mathGame.rickardwg/Models/GameEntry.cs new file mode 100644 index 00000000..46f1a703 --- /dev/null +++ b/mathGame.rickardwg/Models/GameEntry.cs @@ -0,0 +1,13 @@ +using MathGame.Enums; + +namespace MathGame.Models; + +internal class GameEntry +{ + internal int Id { get; set; } + internal GameMode GameMode { get; set; } + internal Difficulty Difficulty { get; set; } + internal int CorrectAnswers { get; set; } + internal int TotalQuestions { get; set; } + internal TimeSpan TimeTaken { get; set; } +} diff --git a/mathGame.rickardwg/Models/MathQuestion.cs b/mathGame.rickardwg/Models/MathQuestion.cs new file mode 100644 index 00000000..db95187d --- /dev/null +++ b/mathGame.rickardwg/Models/MathQuestion.cs @@ -0,0 +1,11 @@ +using MathGame.Enums; + +namespace MathGame.Models; + +internal class MathQuestion +{ + internal int LeftOperand { get; set; } + internal int RightOperand { get; set; } + internal Operation Operation { get; set; } + internal int CorrectAnswer { get; set; } +} diff --git a/mathGame.rickardwg/Program.cs b/mathGame.rickardwg/Program.cs new file mode 100644 index 00000000..648eb3c5 --- /dev/null +++ b/mathGame.rickardwg/Program.cs @@ -0,0 +1,11 @@ +using MathGame.Extensions; +using MathGame.Menus; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +var builder = Host.CreateApplicationBuilder(); +builder.Services.AddCustomServices(); +using var host = builder.Build(); + +var mainMenu = host.Services.GetRequiredService(); +mainMenu.Display(); \ No newline at end of file diff --git a/mathGame.rickardwg/Repositories/HistoryRepository.cs b/mathGame.rickardwg/Repositories/HistoryRepository.cs new file mode 100644 index 00000000..5bd7218f --- /dev/null +++ b/mathGame.rickardwg/Repositories/HistoryRepository.cs @@ -0,0 +1,21 @@ +using MathGame.DataSource; +using MathGame.Models; + +namespace MathGame.Repositories; + +internal class HistoryRepository(IGameHistoryData dataSource) : IHistoryRepository +{ + private readonly IGameHistoryData _dataSource = dataSource; + + public List GetGameHistory() + { + return _dataSource.GameHistory; + } + + public bool AddGameEntry(GameEntry entry) + { + entry.Id = _dataSource.GameHistory.Count + 1; + _dataSource.GameHistory.Add(entry); + return true; + } +} diff --git a/mathGame.rickardwg/Repositories/IHistoryRepository.cs b/mathGame.rickardwg/Repositories/IHistoryRepository.cs new file mode 100644 index 00000000..ab7284eb --- /dev/null +++ b/mathGame.rickardwg/Repositories/IHistoryRepository.cs @@ -0,0 +1,9 @@ +using MathGame.Models; + +namespace MathGame.Repositories; + +internal interface IHistoryRepository +{ + List GetGameHistory(); + bool AddGameEntry(GameEntry entry); +} diff --git a/mathGame.rickardwg/Services/GameService.cs b/mathGame.rickardwg/Services/GameService.cs new file mode 100644 index 00000000..24504859 --- /dev/null +++ b/mathGame.rickardwg/Services/GameService.cs @@ -0,0 +1,72 @@ +using MathGame.Enums; +using MathGame.Models; +using MathGame.Repositories; +using System.Diagnostics; + +namespace MathGame.Services; + +internal class GameService(IQuestionService questionService, IHistoryRepository historyRepository) : IGameService +{ + private readonly IQuestionService _questionService = questionService; + private readonly IHistoryRepository _historyRepository = historyRepository; + + private const int TotalQuestions = 5; + private readonly Stopwatch _stopwatch = new(); + + public bool IsFinished { get; set; } + private int _currentQuestionNumber; + private int _correctAnswers; + private GameMode _gameMode; + private Difficulty _difficulty; + private MathQuestion? _currentQuestion; + + public void StartGame(GameMode gameMode, Difficulty difficulty) + { + IsFinished = false; + _currentQuestionNumber = 0; + _correctAnswers = 0; + _gameMode = gameMode; + _difficulty = difficulty; + _stopwatch.Restart(); + } + + public MathQuestion GetCurrentQuestion() + { + _currentQuestionNumber++; + _currentQuestion = _questionService.GenerateQuestion(_gameMode, _difficulty); + + if (_currentQuestionNumber == TotalQuestions) + { + IsFinished = true; + } + + return _currentQuestion; + } + + public bool SubmitAnswer(int answer) + { + var result = answer == _currentQuestion!.CorrectAnswer; + if (result) + { + _correctAnswers++; + } + return result; + } + + public GameEntry EndGame() + { + _stopwatch.Stop(); + + var entry = new GameEntry() + { + GameMode = _gameMode, + Difficulty = _difficulty, + CorrectAnswers = _correctAnswers, + TotalQuestions = TotalQuestions, + TimeTaken = _stopwatch.Elapsed + }; + + _historyRepository.AddGameEntry(entry); + return entry; + } +} diff --git a/mathGame.rickardwg/Services/IGameService.cs b/mathGame.rickardwg/Services/IGameService.cs new file mode 100644 index 00000000..ba8ed23c --- /dev/null +++ b/mathGame.rickardwg/Services/IGameService.cs @@ -0,0 +1,13 @@ +using MathGame.Enums; +using MathGame.Models; + +namespace MathGame.Services; + +internal interface IGameService +{ + bool IsFinished { get; set; } + void StartGame(GameMode gameMode, Difficulty difficulty); + MathQuestion GetCurrentQuestion(); + bool SubmitAnswer(int answer); + GameEntry EndGame(); +} diff --git a/mathGame.rickardwg/Services/IQuestionService.cs b/mathGame.rickardwg/Services/IQuestionService.cs new file mode 100644 index 00000000..cf23df8c --- /dev/null +++ b/mathGame.rickardwg/Services/IQuestionService.cs @@ -0,0 +1,9 @@ +using MathGame.Enums; +using MathGame.Models; + +namespace MathGame.Services; + +internal interface IQuestionService +{ + MathQuestion GenerateQuestion(GameMode gameMode, Difficulty difficulty); +} diff --git a/mathGame.rickardwg/Services/QuestionService.cs b/mathGame.rickardwg/Services/QuestionService.cs new file mode 100644 index 00000000..9ea57973 --- /dev/null +++ b/mathGame.rickardwg/Services/QuestionService.cs @@ -0,0 +1,101 @@ +using MathGame.Enums; +using MathGame.Models; + +namespace MathGame.Services; + +internal class QuestionService : IQuestionService +{ + private const int EasyMaxValue = 10; + private const int MediumMaxValue = 50; + private const int HardMaxValue = 100; + + public MathQuestion GenerateQuestion(GameMode gameMode, Difficulty difficulty) + { + var operation = GetOperation(gameMode); + var maxAnswerValue = GetMaxAnswerValue(difficulty); + + var (leftOperand, rightOperand, correctAnswer) = operation switch + { + Operation.Add => GenerateAddition(maxAnswerValue), + Operation.Subtract => GenerateSubtraction(maxAnswerValue), + Operation.Multiply => GenerateMultiplication(maxAnswerValue), + Operation.Divide => GenerateDivision(maxAnswerValue), + _ => throw new InvalidOperationException($"Unsupported operation: {operation}") + }; + + return new MathQuestion + { + LeftOperand = leftOperand, + RightOperand = rightOperand, + Operation = operation, + CorrectAnswer = correctAnswer, + }; + } + + private Operation GetOperation(GameMode gameMode) + { + if (gameMode == GameMode.Random) + { + var values = Enum.GetValues(); + return values[Random.Shared.Next(values.Length)]; + } + + return gameMode switch + { + GameMode.Addition => Operation.Add, + GameMode.Subtraction => Operation.Subtract, + GameMode.Multiplication => Operation.Multiply, + GameMode.Division => Operation.Divide, + _ => throw new ArgumentOutOfRangeException(nameof(gameMode), gameMode, "Unsupported game mode.") + }; + } + + private int GetMaxAnswerValue(Difficulty difficulty) + { + return difficulty switch + { + Difficulty.Easy => EasyMaxValue, + Difficulty.Medium => MediumMaxValue, + Difficulty.Hard => HardMaxValue, + _ => throw new ArgumentOutOfRangeException(nameof(difficulty), difficulty, "Unsupported difficulty.") + }; + } + + private (int LeftOperand, int RightOperand, int CorrectAnswer) GenerateAddition(int maxAnswerValue) + { + int correctAnswer = Random.Shared.Next(1, maxAnswerValue + 1); + int leftOperand = Random.Shared.Next(1, correctAnswer); + int rightOperand = correctAnswer - leftOperand; + + return (leftOperand, rightOperand, correctAnswer); + } + + private (int LeftOperand, int RightOperand, int CorrectAnswer) GenerateSubtraction(int maxAnswerValue) + { + int leftOperand = Random.Shared.Next(1, maxAnswerValue + 1); + int rightOperand = Random.Shared.Next(1, leftOperand); + int correctAnswer = leftOperand - rightOperand; + + return (leftOperand, rightOperand, correctAnswer); + } + + private (int LeftOperand, int RightOperand, int CorrectAnswer) GenerateMultiplication(int maxAnswerValue) + { + int leftOperand = Random.Shared.Next(2, maxAnswerValue + 1); + int maxRightOperand = maxAnswerValue / leftOperand; + int rightOperand = Random.Shared.Next(1, maxRightOperand + 1); + int correctAnswer = leftOperand * rightOperand; + + return (leftOperand, rightOperand, correctAnswer); + } + + private (int LeftOperand, int RightOperand, int CorrectAnswer) GenerateDivision(int maxAnswerValue) + { + int rightOperand = Random.Shared.Next(1, maxAnswerValue + 1); + int maxCorrectAnswer = maxAnswerValue / rightOperand; + int correctAnswer = Random.Shared.Next(maxCorrectAnswer + 1); + int leftOperand = rightOperand * correctAnswer; + + return (leftOperand, rightOperand, correctAnswer); + } +} diff --git a/mathGame.rickardwg/Views/GameHistoryView.cs b/mathGame.rickardwg/Views/GameHistoryView.cs new file mode 100644 index 00000000..89291359 --- /dev/null +++ b/mathGame.rickardwg/Views/GameHistoryView.cs @@ -0,0 +1,41 @@ +using MathGame.Helpers; +using MathGame.Repositories; + +namespace MathGame.Views; + +internal class GameHistoryView(IHistoryRepository historyRepository) : IGameHistoryView +{ + private readonly IHistoryRepository _historyRepository = historyRepository; + public void DisplayHistory() + { + Console.Clear(); + ConsoleHelper.WriteLine("Game History:"); + Console.WriteLine(); + + foreach (var entry in _historyRepository.GetGameHistory()) + { + ConsoleHelper.Write("Game #"); + ConsoleHelper.WriteLine($"{entry.Id}", ConsoleColor.Yellow); + + ConsoleHelper.Write("Game Mode: "); + ConsoleHelper.WriteLine($"{entry.GameMode}", ConsoleColor.Yellow); + + ConsoleHelper.Write("Difficulty: "); + ConsoleHelper.WriteLine($"{entry.Difficulty}", ConsoleColor.Yellow); + + ConsoleHelper.Write("Score: "); + ConsoleHelper.Write($"{entry.CorrectAnswers}", ConsoleColor.Yellow); + ConsoleHelper.Write(" / "); + ConsoleHelper.WriteLine($"{entry.TotalQuestions}", ConsoleColor.Yellow); + + ConsoleHelper.Write("Time: "); + ConsoleHelper.Write($"{entry.TimeTaken.TotalSeconds:0}", ConsoleColor.Yellow); + ConsoleHelper.WriteLine(" seconds"); + + Console.WriteLine(); + } + + ConsoleHelper.WriteLine("Press any key to continue...", ConsoleColor.Yellow); + Console.ReadKey(); + } +} diff --git a/mathGame.rickardwg/Views/GameView.cs b/mathGame.rickardwg/Views/GameView.cs new file mode 100644 index 00000000..77427119 --- /dev/null +++ b/mathGame.rickardwg/Views/GameView.cs @@ -0,0 +1,98 @@ +using MathGame.Enums; +using MathGame.Helpers; +using MathGame.Models; +using MathGame.Services; + +namespace MathGame.Views; + +internal class GameView(IGameService gameService) : IGameView +{ + private readonly IGameService _gameService = gameService; + public void DisplayGame(GameMode gameMode, Difficulty difficulty) + { + Console.Clear(); + _gameService.StartGame(gameMode, difficulty); + + while (!_gameService.IsFinished) + { + var question = _gameService.GetCurrentQuestion(); + + DisplayQuestion(question); + + var answer = ReadAnswer(); + + var result = _gameService.SubmitAnswer(answer); + + DisplayResult(result, question.CorrectAnswer); + } + var entry = _gameService.EndGame(); + DisplaySummary(entry); + + Console.WriteLine(); + ConsoleHelper.WriteLine("Press any key to continue...", ConsoleColor.Yellow); + Console.ReadKey(); + } + + private void DisplayQuestion(MathQuestion question) + { + var operationSymbol = GetOperationSymbol(question.Operation); + + ConsoleHelper.Write("What is "); + ConsoleHelper.Write($"{question.LeftOperand}", ConsoleColor.Yellow); + ConsoleHelper.Write($" {operationSymbol} "); + ConsoleHelper.Write($"{question.RightOperand}", ConsoleColor.Yellow); + ConsoleHelper.Write(" = "); + ConsoleHelper.Write("?", ConsoleColor.Yellow); + Console.WriteLine(); + } + + private int ReadAnswer() + { + int.TryParse(Console.ReadLine(), out int result); + return result; + } + + private void DisplayResult(bool result, int correctAnswer) + { + if (result) + { + ConsoleHelper.WriteLine("Correct!", ConsoleColor.Green); + } + else + { + ConsoleHelper.Write("Incorrect!", ConsoleColor.Red); + ConsoleHelper.Write(" The answer was "); + ConsoleHelper.Write($"{correctAnswer}", ConsoleColor.Yellow); + ConsoleHelper.Write("."); + Console.WriteLine(); + } + Console.WriteLine(); + } + + private void DisplaySummary(GameEntry entry) + { + ConsoleColor scoreColor = entry.CorrectAnswers == entry.TotalQuestions ? ConsoleColor.Green : ConsoleColor.Red; + ConsoleHelper.Write("Score: "); + ConsoleHelper.Write($"{entry.CorrectAnswers}", scoreColor); + ConsoleHelper.Write(" / "); + ConsoleHelper.Write($"{entry.TotalQuestions}", scoreColor); + Console.WriteLine(); + + ConsoleHelper.Write("Time: "); + ConsoleHelper.Write($"{entry.TimeTaken.TotalSeconds:0}", ConsoleColor.Yellow); + ConsoleHelper.Write(" seconds."); + Console.WriteLine(); + } + + private string GetOperationSymbol(Operation operation) + { + return operation switch + { + Operation.Add => "+", + Operation.Subtract => "-", + Operation.Multiply => "*", + Operation.Divide => "/", + _ => throw new ArgumentOutOfRangeException(nameof(operation), operation, "Unsupported operation.") + }; + } +} diff --git a/mathGame.rickardwg/Views/IGameHistoryView.cs b/mathGame.rickardwg/Views/IGameHistoryView.cs new file mode 100644 index 00000000..4c9870e2 --- /dev/null +++ b/mathGame.rickardwg/Views/IGameHistoryView.cs @@ -0,0 +1,6 @@ +namespace MathGame.Views; + +internal interface IGameHistoryView +{ + void DisplayHistory(); +} diff --git a/mathGame.rickardwg/Views/IGameView.cs b/mathGame.rickardwg/Views/IGameView.cs new file mode 100644 index 00000000..fd31fa96 --- /dev/null +++ b/mathGame.rickardwg/Views/IGameView.cs @@ -0,0 +1,8 @@ +using MathGame.Enums; + +namespace MathGame.Views; + +internal interface IGameView +{ + void DisplayGame(GameMode gameMode, Difficulty difficulty); +}