コード例 #1
0
ファイル: TemplatesHolder.cs プロジェクト: lunice/bgo
    int[] getTicketPositions(categoriesJSON c, int templateNum)
    {
        //var c = getCategoryByID(categoryID);
        var t = getTemplate(c, templateNum);

        //for (int i = 0; i < t.Positions.Length; i++) print(t.Positions[i]);
        if (t != null)
        {
            return(t.Positions);
        }
        //print("Error! [getTicketPositions] categoryID#"+ c.CatId + " with template#"+ templateNum + " not find!");
        return(new int[] { });
    }
コード例 #2
0
ファイル: TemplatesHolder.cs プロジェクト: lunice/bgo
    // (отлкючено) Получить категорию по её индексу в масиве

    /*categoriesJSON getCategory(int index) {
     *  print("getCategory(" + index + ")");
     *  return serverTemplates.Cat[index];
     * }*/
    // Получить шаблоны из указаной категории, по указаному (JSON) id
    templatesJSON getTemplate(categoriesJSON inCategory, int id)
    {
        if (inCategory != null)
        {
            //print("inCategory.Templates.Length: " + inCategory.Templates.Length);
            for (int i = 0; i < inCategory.Templates.Length; i++)
            {
                if (inCategory.Templates[i].Templ_id == id)
                {
                    return(inCategory.Templates[i]);
                }
            }
        }
        return(null);
    }