예제 #1
0
        public ModCraftingRecipe(string name, IRecipe recipe, bool isCookingRecipe) : base("Torch", isCookingRecipe)
        {
            this.Recipe          = recipe;
            this.ComponentWidth  = (int)Math.Ceiling(recipe.Sprite.Width / 16f);
            this.ComponentHeight = (int)Math.Ceiling(recipe.Sprite.Height / 16f);

            // Recipe details
            this.name        = name;
            this.DisplayName = recipe.GetDisplayName();
            ModCraftingRecipe._descriptionField.SetValue(this, recipe.GetDescription());
            this.timesCrafted           = Game1.player.craftingRecipes.ContainsKey(name) ? Game1.player.craftingRecipes[name] : 0;
            this.numberProducedPerCraft = recipe.Results.Count() == 1 ? recipe.Results.First().Quantity : 1;
        }