Пример #1
0
        public static void MainMenu(GameController Controller, pokerpalooza_repo Repo)
        {
            while (true)
            {
                Console.WriteLine("\n* Player Menu *");
                Console.WriteLine("1. View all stored players");
                Console.WriteLine("2. Add a new player");
                Console.WriteLine("X. Go Back");
                Console.Write("--> ");

                switch (Console.ReadLine().ToLowerInvariant())
                {
                    case "x":
                        return;
                    case "1":
                        ShowAllPlayers(Repo);
                        break;
                    case "2":
                        AddPlayer(Repo);
                        break;
                    default:
                        Console.WriteLine("You fell off the top of the stupid tree.");
                        continue;
                }
            }
        }
Пример #2
0
        public static void MainMenu(GameController Controller)
        {
            while (true)
            {
                Console.WriteLine("\n** Game menu **");
                Console.WriteLine("1. Show current game status");
                Console.WriteLine("2. Create a New Game");
                Console.WriteLine("3. Add player to current game");
                Console.WriteLine("4. Create New Blind Setup");
                Console.WriteLine("X. Go back");
                Console.Write("--> ");

                try
                {
                    switch (Console.ReadLine().ToLowerInvariant())
                    {
                        case "x":
                            return;
                        case "1":
                            Helper.ShowGame(Controller.ActiveGame);
                            break;
                        case "2":
                            NewGame(Controller);
                            break;
                        case "3":
                            AddPlayerToCurrentGame(Controller);
                            break;
                        default:
                            Console.WriteLine("what the f**k?");
                            continue;
                    }
                }
                catch (Exception e) { Console.WriteLine(e.Message); }
            }
        }
Пример #3
0
        public static void NewGame(GameController Controller)
        {
            int buyin, bounty;
            DateTime gameDate;

            while (true)
            {
                Console.Write("Enter game date: ");
                try
                {
                    gameDate = DateTime.Parse(Console.ReadLine());
                }
                catch (Exception)
                {
                    Console.WriteLine("Jesus Christ, enter a f*****g date.");
                    continue;
                }
                break;
            }

            gameDate = gameDate.AddHours(19);

            while (true)
            {
                Console.Write("Enter Buyin: ");
                try
                {
                    buyin = int.Parse(Console.ReadLine());
                }
                catch (Exception)
                {
                    Console.WriteLine("Are you tarded?");
                    continue;
                }
                break;
            }

            while (true)
            {
                Console.Write("Enter Bounty (default 0): ");
                string input = Console.ReadLine();

                try
                {
                    bounty = input.Equals("") ? 0 : int.Parse(input);
                }
                catch (Exception)
                {
                    Console.WriteLine("I said bounty fucktwat");
                    continue;
                }
                break;
            }

            Controller.NewGame(gameDate, buyin, bounty == 0 ? (int?)null : bounty, null);
        }
Пример #4
0
        public pokerpalooza()
        {
            Creator = new DatabaseCreator(ConfigurationManager.ConnectionStrings["pokerpalooza-db"].ConnectionString);
            Creator.OverwriteExisting = true;

            Repo = new pokerpalooza_repo(ConfigurationManager.ConnectionStrings["pokerpalooza-db"].ConnectionString);
            Controller = new GameController(Repo);

            menu();
        }
Пример #5
0
        static void AddPlayerToCurrentGame(GameController controller)
        {
            List<Player> availablePlayers = controller.AvailablePlayersForGame().ToList();

            if (controller.AvailablePlayersForGame().Count() == 0)
            {
                Console.WriteLine("There are no available players for the current game.");
                return;
            }

            while (true)
            {
                Console.WriteLine("\nSelect player to add to current game:");
                for (int i = 0; i < availablePlayers.Count(); i++)
                    Console.WriteLine("{0}: {1}", i.ToString(), availablePlayers[i].DisplayName);

                try
                {
                    controller.AddPlayer(availablePlayers[int.Parse(Console.ReadLine())]);
                    Console.WriteLine("{0} was added to the current game.");
                    break;
                }
                catch (Exception)
                {
                    Console.WriteLine("ENGLISH M**********R DO YOU SPEAK IT");
                }
            }
        }
Пример #6
0
 public void SetUpAllTheThings()
 {
     Repo = new pokerpalooza_repo(ConfigurationManager.ConnectionStrings["pokerpalooza-db"].ConnectionString);
     Controller = new GameController(Repo);
     Controller.NewGame(DateTime.Now, 10, null, null);
 }