Example #1
0
        private void DrawCoord(Field sender, MoveArgs e)
        {
            Console.SetCursorPosition(e.Col, e.Row);

            Console.ForegroundColor = GetColor(e);

            Console.Write(GetChar(e.Value));
        }
Example #2
0
        private static ConsoleColor GetColor(MoveArgs e)
        {
            return(e.Value switch
            {
                Field.Mine when e.Move == Move.Reveal => ConsoleColor.Yellow,

                Field.Mine when e.Move != Move.Reveal => ConsoleColor.Red,

                _ => ConsoleColor.Gray
            });