From 002a851fc2439e22a77263d1d2161c211d6562d5 Mon Sep 17 00:00:00 2001 From: Marvin Rohrbach Date: Fri, 25 May 2018 11:30:18 +0200 Subject: [PATCH] Add numbers --- CoopSweeper/GameTypes/Field.cs | 3 ++- CoopSweeper/Program.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CoopSweeper/GameTypes/Field.cs b/CoopSweeper/GameTypes/Field.cs index 46dab75..1e83a60 100644 --- a/CoopSweeper/GameTypes/Field.cs +++ b/CoopSweeper/GameTypes/Field.cs @@ -18,6 +18,7 @@ namespace CoopSweeper.GameTypes public FieldState State { get; set; } public int SurroundingBombs { get; set; } + public int CheckID { get; set; } public DisplayState GetDisplayState() @@ -31,7 +32,7 @@ namespace CoopSweeper.GameTypes case FieldState.REVEALED: if(ContainsBomb) return DisplayState.BOMB; - return 0; + return (DisplayState)SurroundingBombs; } return DisplayState.ERROR; } diff --git a/CoopSweeper/Program.cs b/CoopSweeper/Program.cs index 21d417e..e7e3110 100644 --- a/CoopSweeper/Program.cs +++ b/CoopSweeper/Program.cs @@ -33,7 +33,7 @@ namespace CoopSweeper case ConsoleKey.Spacebar: game.Reveal(cursorPosX, cursorPosY); break; case ConsoleKey.F: - game.SetFlag(cursorPosX, cursorPosY); break; + game.ToggleMark(cursorPosX, cursorPosY); break; } if (cursorPosX < 0) cursorPosX = 0; if (cursorPosY < 0) cursorPosY = 0; @@ -87,7 +87,7 @@ namespace CoopSweeper case DisplayState.NUMBER8: fgChanged = true; Console.ForegroundColor = ConsoleColor.Yellow; - c = state.ToString()[0]; + c = ((int)state).ToString()[0]; break; } if (isCursor)