Exemplo n.º 1
0
        public static List <RecipeItem> Create(RecipeCounter counter, RecipeItem item, List <object[]> dataSet)
        {
            List <RecipeItem> items = new List <RecipeItem>();

            foreach (var row in dataSet)
            {
                var recItem = Create(counter, row);
                recItem.Parent = item;
                items.Add(recItem);
            }

            return(items);
        }
Exemplo n.º 2
0
        public static RecipeItem Create(RecipeCounter counter, object[] row)
        {
            int        i          = 0;
            RecipeItem recipeItem = new RecipeItem(counter);
            Item       item       = new Item
            {
                Id           = row[i++].ConvertTo <int>(),
                Name         = row[i++].ConvertTo <string>(),
                SellPrice    = row[i++].ConvertTo <int>(),
                BuyPrice     = row[i++].ConvertTo <int>(),
                SellOffers   = row[i++].ConvertTo <int>(),
                BuyOrders    = row[i++].ConvertTo <int>(),
                Timestamp    = row[i++].ConvertTo <DateTime>(),
                RarityId     = row[i++].ConvertTo <int>(),
                RarityName   = row[i++].ConvertTo <string>(),
                CategoryId   = row[i++].ConvertTo <int>(),
                CategoryName = row[i++].ConvertTo <string>(),
                TypeId       = row[i++].ConvertTo <int>(),
                TypeName     = row[i++].ConvertTo <string>()
            };

            if (DBNull.Value == row[i])
            {
                item.RecipeId = 0;
            }
            else
            {
                item.RecipeId = row[i].ConvertTo <int>();
            }
            i++;
            recipeItem.Number = row[i++].ConvertTo <int>();

            recipeItem.Id            = row[i++].ConvertTo <int>();
            recipeItem.FactionNumber = row[i++].ConvertTo <int>();

            item.FactionNumber = recipeItem.FactionNumber;
            item.Faction       = row[i].ConvertTo <string>();

            recipeItem.Item = item;


            return(recipeItem);
        }
Exemplo n.º 3
0
 public RecipeItem(RecipeCounter counter)
 {
     UniqueId = counter.NextId();
 }