Пример #1
0
        public static void TestLootGenerator(Session session, params string[] parameters)
        {
            // This generates loot items and displays the drop rates of LootFactory

            // Switch for different options
            switch (parameters[0])
            {
            case "-info":
                Console.WriteLine("This is for more info on how to use this command");
                break;

            default:
                break;
            }

            if (Int32.TryParse(parameters[0], out int numberItemsGenerate))
            {
                Console.WriteLine("Number of items to generate " + numberItemsGenerate);
            }
            else
            {
                Console.WriteLine("numbr of items is not an integer");
                return;
            }

            if (Int32.TryParse(parameters[1], out int itemsTier))
            {
                Console.WriteLine("tier is " + itemsTier);
            }
            else
            {
                Console.WriteLine("tier is not an integer");
                return;
            }

            Console.WriteLine(LootGenerationFactory_Test.TestLootGen(numberItemsGenerate, itemsTier));

            Console.WriteLine($"Loot Generation of {numberItemsGenerate} items, in tier {itemsTier} complete.");
        }
Пример #2
0
        public static void TestLootGenerator(Session session, params string[] parameters)
        {
            if (parameters[0] == "-info")
            {
                Console.WriteLine($"Usage: \n" +
                                  $"<number of items> <loot tier> <(optional)display table - melee, missile, caster, jewelry, armor, cloak, pet, aetheria> \n" +
                                  $" Example: The following command will generate 1000 items in Tier 7 that shows the melee table\n" +
                                  $"testlootgen 1000 7 melee \n" +
                                  $" Example: The following command will generate 1000 items in Tier 6 that just shows a summary \n" +
                                  $"testlootgen 1000 6 \n");
                return;
            }

            if (!int.TryParse(parameters[0], out int numItems))
            {
                Console.WriteLine("Number of items is not an integer");
                return;
            }

            if (!int.TryParse(parameters[1], out int tier))
            {
                Console.WriteLine("Tier is not an integer");
                return;
            }

            if (tier < 1 || tier > 8)
            {
                Console.WriteLine($"Tier must be 1-8.  You entered tier {tier}, which does not exist!");
                return;
            }

            var logStats     = false;
            var displayTable = "";

            if (parameters.Length > 2)
            {
                switch (parameters[2].ToLower())
                {
                case "melee":
                case "missile":
                case "caster":
                case "jewelry":
                case "armor":
                case "pet":
                case "aetheria":
                case "all":
                case "cloak":
                    displayTable = parameters[2].ToLower();
                    break;

                case "-log":
                    logStats = true;
                    break;

                default:
                    Console.WriteLine("Invalid Table Option.  Available Tables to show are melee, missile, caster, jewelry, armor, cloak, pet, aetheria or all.");
                    return;
                }
            }

            if (parameters.Length > 3)
            {
                var logParam = parameters[3].ToLower();

                if (logParam == "-log")
                {
                    logStats = true;
                }
                else
                {
                    Console.WriteLine("Invalid Option.  To log a file, use option -log");
                    return;
                }
            }

            var results = LootGenerationFactory_Test.TestLootGen(numItems, tier, logStats, displayTable);

            Console.WriteLine(results);
        }
Пример #3
0
        public static void TestLootGenerator(Session session, params string[] parameters)
        {
            // This generates loot items and displays the drop rates of LootFactory
            string logFile      = "";
            string displayTable = "";
            bool   logstats     = false;

            // Switch for different options
            switch (parameters[0])
            {
            case "-info":
                Console.WriteLine($"Usage: \n" +
                                  $"<number of items> <loot tier> <(optional)display table - melee, missile, caster, jewelry, armor, cloak, pet, aetheria> \n" +
                                  $" Example: The following command will generate 1000 items in Tier 7 that shows the melee table\n" +
                                  $"testlootgen 1000 7 melee \n" +
                                  $" Example: The following command will generate 1000 items in Tier 6 that just shows a summary \n" +
                                  $"testlootgen 1000 6 \n");
                return;

            default:
                break;
            }

            if (int.TryParse(parameters[0], out int numberItemsGenerate))
            {
                ////Console.WriteLine("Number of items to generate " + numberItemsGenerate);
            }
            else
            {
                Console.WriteLine("Number of items is not an integer");
                return;
            }

            if (int.TryParse(parameters[1], out int itemsTier))
            {
                ////Console.WriteLine("tier is " + itemsTier);
            }
            else
            {
                Console.WriteLine("Tier is not an integer");
                return;
            }
            if (parameters.Length > 2)
            {
                displayTable = parameters[2].ToLower();
            }
            switch (displayTable)
            {
            case "melee":
            case "missile":
            case "caster":
            case "jewelry":
            case "armor":
            case "pet":
            case "aetheria":
            case "all":
            case "cloak":
            case "":
                break;

            case "-log":
                logstats = true;
                break;

            default:
                Console.WriteLine("Invalid Table Option.  Available Tables to show are melee, missile, caster, jewelry, armor, cloak, pet, aetheria or all.");
                return;
            }
            if (parameters.Length > 3)
            {
                logFile = parameters[3].ToLower();
            }
            switch (logFile)
            {
            case "":
                break;

            case "-log":
                logstats = true;
                // Console.WriteLine("Logging is not currently working, Displaying results to screen.");
                break;

            default:
                Console.WriteLine("Invalid Option.  To log a file, use option -log");
                return;
            }
            if (itemsTier > 0 && itemsTier < 9)
            {
                Console.WriteLine(LootGenerationFactory_Test.TestLootGen(numberItemsGenerate, itemsTier, logstats, displayTable));
            }
            else
            {
                Console.WriteLine($"Tier must be 1-8.  You entered tier {itemsTier}, which does not exist!");
                return;
            }
        }