diff --git a/ConsoleApp/ConsoleApp1/ConsoleApp1.csproj b/ConsoleApp/ConsoleApp1/ConsoleApp1.csproj index 2082704..ccaab63 100644 --- a/ConsoleApp/ConsoleApp1/ConsoleApp1.csproj +++ b/ConsoleApp/ConsoleApp1/ConsoleApp1.csproj @@ -5,4 +5,21 @@ net5.0 + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/ConsoleApp/ConsoleApp1/Program.cs b/ConsoleApp/ConsoleApp1/Program.cs index 76e36ae..7aa1204 100644 --- a/ConsoleApp/ConsoleApp1/Program.cs +++ b/ConsoleApp/ConsoleApp1/Program.cs @@ -1,4 +1,6 @@ using System; +using System.Net.Http; +using System.Threading; namespace ConsoleApp1 { @@ -6,7 +8,48 @@ namespace ConsoleApp1 { static void Main(string[] args) { - Console.WriteLine("Hello World!"); + using (var httpClient = new HttpClient()) + { + Thread.Sleep(5000); + swaggerClient x = new swaggerClient("http://localhost:49746", httpClient); + while (true) + { + Field r = x.NewAsync().Result; + for (int ii = 0; ii < 5; ii++) + { + Thread.Sleep(500); + h_DrawField(r); + r = x.MoveAsync(r.Identifier).Result; + } + } + + } + } + + private static void h_DrawField(Field field) + { + Console.Clear(); + + h_WriteToConsole(field.Identifier, 4, 4, ConsoleColor.Gray); + + + foreach (var item in field.Figures) + { + ConsoleColor cc = item.FigureColor == 1 ? ConsoleColor.Blue : ConsoleColor.Green; + h_WriteToConsole("O", item.PosX, item.PosY, cc); + } + + } + + private static void h_WriteToConsole(string stringToWrite, int posX, int posY, ConsoleColor cc) + { + int realX = posX + 10; + int realY = posY + 10; + ConsoleColor oldCc = Console.ForegroundColor; + Console.ForegroundColor = cc; + Console.SetCursorPosition(realX, realY); + Console.Write(stringToWrite); + Console.ForegroundColor = oldCc; } } } diff --git a/WebApi/Properties/launchSettings.json b/WebApi/Properties/launchSettings.json index 6708034..fe0440f 100644 --- a/WebApi/Properties/launchSettings.json +++ b/WebApi/Properties/launchSettings.json @@ -18,7 +18,7 @@ }, "WebApplication1": { "commandName": "Project", - "dotnetRunMessages": "true", + "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", "applicationUrl": "http://localhost:5000",