Ejemplo n.º 1
0
        public void MainMenu(Characters self)
        {
            Planet locale = new Planet();

            Console.Clear();
            Console.SetCursorPosition(Console.LargestWindowWidth / 3, 0);
            Console.WriteLine($"You are {self.Age} years old at the planet {self.location.PlanetName}");

            Console.SetCursorPosition(Console.LargestWindowWidth / 3, 2);
            Console.WriteLine($"You've got about {self.mySpaceShip.fuel.weight / 100}  LY of fuel.");

            Console.SetCursorPosition(Console.LargestWindowWidth / 3, 4);
            Console.WriteLine("T- Travel S-Trade M-ShipShop");

            while (true)
            {
                ConsoleKeyInfo keyInfo;
                if (Console.KeyAvailable)
                {
                    keyInfo = Console.ReadKey(true);
                    switch (keyInfo.Key)
                    {
                    case ConsoleKey.T:
                        Console.Clear();
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("\t\tYou have chosen to travel");
                        Thread.Sleep(2000);
                        Console.WriteLine("\t\t\n\nIt's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to");
                        Thread.Sleep(4000);
                        Console.ForegroundColor = ConsoleColor.Blue;
                        Console.WriteLine("\t\t\n[Janet] I just love when you quote JRR Tolkien");
                        Thread.Sleep(2000);
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("\t\t\n You say that EVERYTIME.");
                        Thread.Sleep(2000);
                        Console.ForegroundColor = ConsoleColor.Blue;
                        Console.WriteLine("\t\t\n[Janet] I know");
                        Thread.Sleep(2000);
                        Console.WriteLine("\t\t\n...but you should have written the program better.");
                        Thread.Sleep(5000);
                        Console.Clear();
                        TravelMenu(self);
                        break;

                    case ConsoleKey.S:
                        Console.Clear();
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("trade");
                        MarketPlace     marketPlace = new MarketPlace();
                        MarketResources thing       = new MarketResources();
                        var             list        = thing.MarketGenerate(self);
                        marketPlace.InTheMarketPlace(self, list);
                        break;

                    case ConsoleKey.M:
                        Console.Clear();
                        Console.WriteLine("Welcome to the ShipShop!");
                        MoonMarket shipshop = new MoonMarket();
                        shipshop.moonMarketMenu(self);
                        break;
                    }
                }
            }
        }