Exemplo n.º 1
0
        public static List <RecipeValueAnalysis> GetRecipes()
        {
            List <RecipeValueAnalysis> list = new List <RecipeValueAnalysis>();
            var lines = Properties.Resources.VendorRecipes.Split("\r\n");

            foreach (string line in lines)
            {
                var          tokens = CsvLineTokenize(line);
                VendorUnique item   = new VendorUnique {
                    name = tokens[0]
                };
                item.ResultConditions = GetConstraints(tokens[1]);

                for (int i = 2; i < tokens.Length - 1; i += 2)
                {
                    if (!String.IsNullOrEmpty(tokens[i]))
                    {
                        //build ingredient unique item
                        BaseUnique ingredient = new BaseUnique();
                        ingredient.name = tokens[i];
                        //add list of constraints to item
                        item.Ingredients.Add(ingredient, GetConstraints(tokens[i + 1]));
                    }
                }
                list.Add(new RecipeValueAnalysis(item));
            }

            return(list);
        }
Exemplo n.º 2
0
        public static List <ProphecyValueAnalysis> GetUpgrades()
        {
            List <ProphecyValueAnalysis> list = new List <ProphecyValueAnalysis>();

            var lines = Properties.Resources.ProphecyRecipes.Split("\r\n");

            foreach (string line in lines)
            {
                var        tokens   = CsvLineTokenize(line);
                BaseUnique baseItem = new BaseUnique
                {
                    name = tokens[1]
                };

                ResultUnique resultItem = new ResultUnique
                {
                    name = tokens[2]
                };

                UpgradeProphecy prophecy = new UpgradeProphecy
                {
                    name       = tokens[0],
                    resultItem = resultItem,
                    baseItem   = baseItem
                };

                list.Add(new ProphecyValueAnalysis(prophecy));
            }

            return(list);
        }