Exemple #1
0
        public async Task PrivateGameAsync(string controller, string secondary)
        {
            string logo = "Create a new game or connect to exist server => ";

            string[] options         = new string[] { "Join", "Create", "Exit" };
            Menu     privateGameMenu = new Menu(logo, options);

            int  result = privateGameMenu.Run();
            bool isAuth = false;

            switch (result)
            {
            case 0:
                Console.WriteLine("Enter pls your partner's id to enter to lobby: ");
                string guid = Console.ReadLine().Trim();

                if (isAuth = await GetPrivateAsync($"/{controller}", $"/{auth.AuthUser.Login}/{guid}"))
                {
                    auth.Guid = guid;
                }

                break;

            case 1:
                isAuth = await GetCreateAsync($"/{controller}", $"/create/", $"{auth.AuthUser.Login}");

                break;

            default: return;
            }
            if (isAuth)
            {
                GameProcess gameProcess = new GameProcess(auth);
                TheGame     game        = new TheGame(gameProcess);
                await game.Play(controller, secondary);
            }
        }
Exemple #2
0
 public TheGame(GameProcess gameProcess)
 {
     this.gameProcess = gameProcess;
 }