예제 #1
0
    public CraftingRecipeResult(Recipe_Results recipeResult)
    {
        ParentRecipe = new CraftingRecipe(recipeResult.recipeID);
        Count = recipeResult.count;
        Type = (ItemTypeEnum)recipeResult.type;
        MinimumGrade = (GradeEnum)recipeResult.grade;
        Group = recipeResult.groupID;
        Difficulty = (DifficultyEnum)recipeResult.level;

        switch (Type)
        {
            case ItemTypeEnum.Item:
                Result = new ItemBase(recipeResult.resultID);
                break;
            case ItemTypeEnum.Fitting:
                Result = new FittingBase(recipeResult.resultID);
                break;
            case ItemTypeEnum.Blueprint:
                Result = new BlueprintBase(recipeResult.resultID);
                break;
        } // switch (Type)

        Filters = new List<CraftingRecipeFilter>();
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter1ID, recipeResult.ingCount1, 1));
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter2ID, recipeResult.ingCount2, 2));
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter3ID, recipeResult.ingCount3, 3));
        Filters.Add(new CraftingRecipeFilter(ParentRecipe.ID, recipeResult.filter4ID, recipeResult.ingCount4, 4));
    } // constructor
예제 #2
0
        protected override void OnEnable()
        {
            // Get blueprint type info
            _blueprintBase = (BlueprintBase)target;

            base.OnEnable();
        }
예제 #3
0
    // Добавление ноды в шаблон
    public void AppendBlueprint(BlueprintBase.TypeBlueprint typeBlueprint)
    {
        print($"Blueprint is create {typeBlueprint}");
        GameObject    blue     = Instantiate(basePlane, content.transform);
        BlueprintBase blueBase = blue.GetComponent <BlueprintBase>();

        blueBase.typeBlueprint = typeBlueprint;


        gameBlueprints.Add(blue);
        blueprintBases.Add(blueBase);
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (String.IsNullOrEmpty(Request.QueryString.Get("BlueprintID"))) { Response.Redirect("~/Blueprints/Default.aspx"); }

        int currentID = Convert.ToInt32(Request.QueryString.Get("BlueprintID"));
        CurrentBlueprint = new BlueprintBase(currentID);
        if (CurrentBlueprint == null || CurrentBlueprint.Name.Equals("n/a")) { Response.Redirect("~/Blueprints/Default.aspx"); }
        Title = CurrentBlueprint.Name;

        grd_Recipes.DataSource = CurrentBlueprint.Recipes;
        grd_Recipes.DataBind();

        RecipeWrapper.Visible = grd_Recipes.Rows.Count > 0;
    } // method Page_Load
예제 #5
0
    } // method rpt_Fittings_ItemDataBound

    protected void rpt_Blueprints_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        switch (e.Item.ItemType)
        {
            case ListItemType.Item:
            case ListItemType.AlternatingItem:
                {
                    HyperLink recipeLink = (HyperLink)e.Item.FindControl("lnk_RecipeLink");
                    BlueprintBase currentItem = (BlueprintBase)e.Item.DataItem;
                    var singleRecipe = (from item in currentItem.Recipes
                                        where item.ParentSkill.ID == CurrentSkill.ID
                                        select item).FirstOrDefault();
                    recipeLink.Text = singleRecipe.Name;
                    recipeLink.NavigateUrl = singleRecipe.URL;
                    break;
                }
        } // switch
    } // method rpt_Blueprints_ItemDataBound