Esempio n. 1
0
        private ArtisanRecipe MapRecipe(ArtisanId artisanId, ArtisanRecipeRank rank, ArtisanRecipeSource source, ArtisanRecipeDto input)
        {
            var reagents = MapReagents(input.Reagents);

            return(new ArtisanRecipe
            {
                Id = new RecipeId(artisanId, input.Slug),
                Name = input.Name,
                Cost = input.Cost,
                Rank = rank,
                Source = source,
                Reagents = reagents,
                CraftedItemId = new ItemId(input.ItemProduced.Slug, input.ItemProduced.Id)
            });
        }
Esempio n. 2
0
        private IEnumerable <ArtisanRecipe> MapRecipes(ArtisanId artisanId, ArtisanRecipeRank rank, ArtisanRecipeSource source, IEnumerable <ArtisanRecipeDto> inputs)
        {
            var outputs = new List <ArtisanRecipe>();

            foreach (var input in inputs)
            {
                var output = MapRecipe(artisanId, rank, source, input);
                outputs.Add(output);
            }

            return(outputs);
        }