Ejemplo n.º 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), 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);
        }
Ejemplo n.º 2
0
        public override void NightClub()
        {
            Console.WriteLine("1.Employees (150 mon.)" +
                              "2.Space (250 mon.)" +
                              "3.Withdraw Cash" +
                              "0.Exit");
            switch (Validation.DefaultValidation())
            {
            case 1:
            {
                Console.WriteLine("Employees: " + employeesCount);
                Console.WriteLine("How many employees do you want to buy? ");
                byte temp = Validation.DefaultValidation();
                if ((employeesCount + temp) > spaceCount * 2)
                {
                    Console.WriteLine("You should buy more space for employees!");
                }
                else
                {
                    money          -= temp * 150;
                    employeesCount += temp;
                }
            }
            break;

            case 2:
            {
                Console.WriteLine("Space: " + spaceCount);
                Console.WriteLine("How many space do you want to buy? ");
                byte temp = Validation.DefaultValidation();
                if ((money - temp * 250) < -100)
                {
                    Console.WriteLine("You can't buy such amount of space because you lose this game!");
                }
                else
                {
                    money      -= temp * 150;
                    spaceCount += temp;
                }
            }
            break;

            case 3:
            {
                money         += cashOfBusiness;
                cashOfBusiness = 0;
            }
            break;

            case 0: break;

            default: Console.WriteLine("Enter digit in the border of menu."); break;
            }
        }
Ejemplo n.º 3
0
        public override void Tournament(byte i)
        {
            Random rnd = new Random();

            switch (i)
            {
            case (byte)Competition.Amateur:
            {
                int comp = rnd.Next(0, 50);
                if (comp >= 25 && strength > 25)
                {
                    Console.WriteLine("Congratulations! You have won Amateur tournament in " + this.TypeOfSection);
                    strength    = 0;
                    popularity += 50;
                }
                else
                {
                    Console.WriteLine("Don't worry, you can be better the next time!");
                }
            }
            break;

            case (byte)Competition.Professional:
            {
                int comp = rnd.Next(0, 50);
                if (comp >= 42 && strength > 100)
                {
                    Console.WriteLine("Congratulations! You have won Professional tournament in " + this.TypeOfSection);
                    strength    = 0;
                    popularity += 100;
                }
                else
                {
                    Console.WriteLine("Maybe you aren't too strong for that competition...");
                }
            }
            break;

            case (byte)Competition.Olympiad:
            {
                int comp = rnd.Next(0, 50);
                if (comp >= 49 && strength > 250)
                {
                    Console.WriteLine("Congratulations! You have won Professional tournament in " + this.TypeOfSection);
                    strength    = 0;
                    popularity += 1500;
                }
            }
            break;

            case (byte)Competition.Prepearing: Sport(Validation.DefaultValidation()); break;
            }
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
0
 public override byte HeadMenu()
 {
     base.HeadMenu();
     Console.WriteLine("Computer Upgrade(9):");
     return(Validation.DefaultValidation());
 }
Ejemplo n.º 6
0
 public override byte HeadMenu()
 {
     base.HeadMenu();
     Console.WriteLine("Business(9):");
     return(Validation.DefaultValidation());
 }