Beispiel #1
0
        public static List <Student> Enter(out byte temp)
        {
            Console.WriteLine("Hello, unfortunately you ended up in the wrong place and consciousness.");
            Console.WriteLine("What is your name?");
            string         name     = Console.ReadLine();
            List <Student> students = new List <Student>()
            {
                new BusinessStudent(name, 10000, 50), new SportStudent(name, "Football"), new ItStudent(name, "C#")
            };

            Console.WriteLine("What type of student are you? (1.Business 2.Sport 3.IT)");
            temp = Validation.DefaultValidation();
            students[temp - 1].Info(name);
            Console.WriteLine("Do you want to add some money for good start :D? Yes(1)/No(0)");
            if (Validation.CheckInput() == 1)
            {
                bool checkMoney = Int32.TryParse(Console.ReadLine(), out int cheat);
                while (!checkMoney)
                {
                    Console.WriteLine("Wrong input, please try again.");
                    checkMoney = Int32.TryParse(Console.ReadLine(), out cheat);
                }
                students[temp - 1].Money = cheat;
            }
            return(students);
        }
Beispiel #2
0
        public override void ComputerShopping()
        {
            Console.WriteLine("1.MicroProcessor(150 mon.)\n" +
                              "2.VideoCard(200mon.)\n" +
                              "3.RAM(120mon.)\n" +
                              "4.HDD(100mon.)\n");
            byte i = Validation.CheckInput();

            Console.WriteLine("How much strength do you want to add?");
            int temp = Validation.DefaultValidation();

            switch (i)
            {
            case (byte)Accessories.Microprocessor:
            {
                microProcessor += temp;
                money          -= temp * 150;
            }
            break;

            case (byte)Accessories.Videocard:
            {
                videoCard += temp;
                money     -= temp * 200;
            }
            break;

            case (byte)Accessories.RAM:
            {
                RAM   += temp;
                money -= 120 * temp;
            }
            break;

            case (byte)Accessories.HDD:
            {
                HDD   += temp;
                money -= 100 * temp;
            }
            break;

            default: Console.WriteLine("You wrote wrong symbol"); break;
            }
            computerStrength += ((microProcessor + videoCard + RAM + HDD) * 0.4);
        }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
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;
            }
        }