예제 #1
0
        public static void Main(string[] args)
        {
            // Create the dictionary that will be used to hold the generators
            generators = new Dictionary<string, TreasureGenerator.TreasureGenerator>(files.Length);

            // Get the files and make generators for them
            for( int i = 0; i < files.Length; i++)
                generators.Add(stripFileName(files[i]), new TreasureGenerator.TreasureGenerator(files[i]));

            coinGen = new CoinGenerator.CoinGenerator();

            // Create the menu items for the treasure menu
            List<MenuItem> menuItems = new List<MenuItem>();
            int menuOrder = 0;
            menuItems.Add(new MenuItem(menuOrder++, "Generate a gem", generateGem));
            menuItems.Add(new MenuItem(menuOrder++, "Generate a treasure", generateArt));
            menuItems.Add(new MenuItem(menuOrder++, "Generate coins", generateCoins));

            // Create the generator menu
            Menu generatorMenu = new Menu(menuItems, "What would you like to generate?", "Return to main menu");

            // Create the menu items for the main menu
            menuItems.Clear();
            menuOrder = 0;

            menuItems.Add(new MenuItem(menuOrder++, "Treasure Generator", generatorMenu.RunMenu));

            // Create the main menu
            Menu mainMenu = new Menu(menuItems);

            // Run the main menu
            mainMenu.RunMenu(wait:false);
        }
예제 #2
0
        public static void Main(string[] args)
        {
            CoinGenerator gen = new CoinGenerator();

            for(int i = 0; i < 20; i++)
                Console.WriteLine(gen.GenerateCoins(100));
        }
        public static void Main(string[] args)
        {
            CoinGenerator gen = new CoinGenerator();

            for (int i = 0; i < 20; i++)
            {
                Console.WriteLine(gen.GenerateCoins(100));
            }
        }
예제 #4
0
        public static void Main(string[] args)
        {
            // Create the dictionary that will be used to hold the generators
            generators = new Dictionary <string, TreasureGenerator.TreasureGenerator>(files.Length);

            // Get the files and make generators for them
            for (int i = 0; i < files.Length; i++)
            {
                generators.Add(stripFileName(files[i]), new TreasureGenerator.TreasureGenerator(files[i]));
            }

            coinGen = new CoinGenerator.CoinGenerator();

            // Create the menu items for the treasure menu
            List <MenuItem> menuItems = new List <MenuItem>();
            int             menuOrder = 0;

            menuItems.Add(new MenuItem(menuOrder++, "Generate a gem", generateGem));
            menuItems.Add(new MenuItem(menuOrder++, "Generate a treasure", generateArt));
            menuItems.Add(new MenuItem(menuOrder++, "Generate coins", generateCoins));

            // Create the generator menu
            Menu generatorMenu = new Menu(menuItems, "What would you like to generate?", "Return to main menu");

            // Create the menu items for the main menu
            menuItems.Clear();
            menuOrder = 0;

            menuItems.Add(new MenuItem(menuOrder++, "Treasure Generator", generatorMenu.RunMenu));

            // Create the main menu
            Menu mainMenu = new Menu(menuItems);


            // Run the main menu
            mainMenu.RunMenu(wait: false);
        }