public static void Act(Student stud)
        {
            stud.CheckDays();
            stud.IsAlive();
            stud.Info();
            byte i = stud.HeadMenu();

            stud.Menu(i);
            switch (i)
            {
            case (byte)Actions.HP: stud.FillingHP(Validation.CheckInput()); break;

            case (byte)Actions.Happiness: stud.AddHappiness(Validation.CheckInput()); break;

            case (byte)Actions.Fullness: stud.FillingFulness(Validation.CheckInput()); break;

            case (byte)Actions.Money:
            {
                switch (Validation.CheckInput())
                {
                case 1: stud.MoneyMake(Validation.CheckInput()); break;

                case 2: stud.MoneyMake(); break;

                case 3: stud.BottlesToMoney(); break;

                default: Console.WriteLine("At that period of time you can't make money by anoter way.."); break;
                }
            }
            break;

            case (byte)Actions.Bottles:
            {
                stud.FindingBottles(Validation.CheckInput());
            }
            break;

            case (byte)Actions.Casino:
            {
                if (stud.CheckClothes())
                {
                    Console.WriteLine("Please choose the game and input the sum of bet.");
                    stud.Casino(Validation.CheckInput());
                }
            }
            break;

            case (byte)Actions.Clothes:
            {
                switch (Validation.CheckInput())
                {
                case 1:
                {
                    Console.WriteLine("Buying clothes:" +
                                      "\n1.Shirt(100 mon.)" +
                                      "\n2.Fashionable pents(150 mon.)" +
                                      "\n3.New boots(200 mon.)" +
                                      "\n4.Buy it all (500 mon.)" +
                                      "\n0.Exit");
                }
                    stud.ShoppingClothes(Validation.CheckInput());
                    break;

                case 2:
                {
                    for (int j = 0; j < 3; j++)
                    {
                        Console.WriteLine(stud[j] + "\n");
                    }
                }
                break;

                default: Console.WriteLine("Wrong input."); break;
                }
            }
            break;

            case (byte)Actions.Education: stud.Studying(); break;

            case (byte)Actions.NightClub:
            {
                if (stud is BusinessStudent)
                {
                    stud.NightClub();
                }
                else if (stud is ItStudent)
                {
                    stud.ComputerShopping();
                }
                else if (stud is SportStudent)
                {
                    stud.Tournament(Validation.CheckInput());
                }
            }
            break;
            }
        }
 public override byte HeadMenu()
 {
     base.HeadMenu();
     Console.WriteLine("Business(9):");
     return(Validation.DefaultValidation());
 }
Exemple #3
0
        public void Casino(byte n)
        {
            Random rnd = new Random();

            switch (n)
            {
            // CoinFlip
            case 1:
            {
                CasinoInfo(true);
                Console.WriteLine("Please, enter side of your side of coin: 0 - observe, 1 - reverse");
                bool checkSide = Int32.TryParse(Console.ReadLine(), out int side);
                while (!checkSide && (side != 0 || side != 1))
                {
                    Console.WriteLine("Haha, you are really hope that you can beat the casino!");
                    checkSide = Int32.TryParse(Console.ReadLine(), out side);
                }
                Console.WriteLine("Please, enter an amount bet.");
                bool checkBet = Int32.TryParse(Console.ReadLine(), out int bet);
                while (!checkBet)
                {
                    Console.WriteLine("Haha, you are really hope that you can beat the casino!");
                    checkBet = Int32.TryParse(Console.ReadLine(), out bet);
                }
                if (side == rnd.Next(0, 1))
                {
                    Console.WriteLine("Congratulations! You won a bet in the coinflip, definetly you should play again!");
                    bet        *= 2;
                    this.money += bet;
                }
                else
                {
                    this.money -= bet;
                    Console.WriteLine("Nothing terrible happened, you can try to win again!");
                }
            }
            break;

            // Jackpot
            case 2:
            {
                CasinoInfo(false);
                Console.WriteLine("Please, choose the type of room (Easy/1), (Middle/2), (Hard/3)");
                byte type = Validation.CheckInput();
                Console.WriteLine("Please, enter an amount of bet.");
                bool checkBet = Int32.TryParse(Console.ReadLine(), out int bet);
                while (!checkBet)
                {
                    Console.WriteLine("Haha, you are really hope that you can beat the casino!");
                    checkBet = Int32.TryParse(Console.ReadLine(), out bet);
                }
                if (!Jackpot(type, bet))
                {
                    this.money -= bet;
                    Console.WriteLine("The main thing is that we are all safe and healthy. Others unnecessary!");
                }
            }
            break;

            case 0: break;

            default: Console.WriteLine("You try to find any other game but isn't find anything."); break;
            }
        }