public void GenerateBarricades(IGraficPoint point, int barricades_count) { Random random = new Random(); int counter = 0; int top, left; void Random() { left = random.Next(0, width); top = random.Next(0, width); } while (counter < barricades_count) { Random(); if (GraficArray[top, left].SYMBOL == '.') { GraficArray[top, left] = point; Walls[top, left] = point.SYMBOL; DrawBarricade(point, left, top); counter++; } } }
private void DrawPoint(IGraficPoint point) { Console.OutputEncoding = System.Text.Encoding.UTF8; Console.SetCursorPosition(Left, Top); Console.ForegroundColor = (ConsoleColor)point.FOREGROUND; Console.BackgroundColor = (ConsoleColor)point.BACKGROUND; Console.Write(point.SYMBOL); }
private void DrawBarricade(IGraficPoint point, int left, int top) { Console.SetCursorPosition(left, top); Console.ForegroundColor = (ConsoleColor)point.FOREGROUND; Console.BackgroundColor = (ConsoleColor)point.BACKGROUND; Console.Write(point.SYMBOL); }