Пример #1
0
 protected void BatchAdd(Item item1, Item item2, Item item3, Item item4, Item item5, Section[] sectionList)
 {
     var itemList = new[] {item1, item2, item3, item4, item5};
     var itemDictionary = new Dictionary<ItemCategory, Item>();
     foreach (var item in itemList)
     {
         if (item != null) itemDictionary.Add(item.Category, item);
     }
     var topList = new List<Section>();
     var bottomList = new List<Section>();
     var leftList = new List<Section>();
     var rightList = new List<Section>();
     foreach (var section in sectionList)
     {
         topList.Add(Section.Line(section.GridX, section.GridY + section.Row, section.Column, section.OffsetX,
             section.OffsetY));
         bottomList.Add(Section.Line(section.GridX, section.GridY - 1, section.Column, section.OffsetX,
             section.OffsetY));
         leftList.Add(Section.Tower(section.GridX - 1, section.GridY, section.Row, section.OffsetX,
             section.OffsetY));
         rightList.Add(Section.Line(section.GridX + section.Column, section.GridY, section.Row, section.OffsetX,
             section.OffsetY));
     }
     ObjectData.Add(itemDictionary[ItemCategory.Body].Clone, sectionList);
     if (itemDictionary.ContainsKey(ItemCategory.TopCap))
         ObjectData.Add(itemDictionary[ItemCategory.TopCap].Clone, topList.ToArray());
     if (itemDictionary.ContainsKey(ItemCategory.BottomCap))
         ObjectData.Add(itemDictionary[ItemCategory.BottomCap].Clone, bottomList.ToArray());
     if (itemDictionary.ContainsKey(ItemCategory.LeftCap))
         ObjectData.Add(itemDictionary[ItemCategory.LeftCap].Clone, leftList.ToArray());
     if (itemDictionary.ContainsKey(ItemCategory.RightCap))
         ObjectData.Add(itemDictionary[ItemCategory.RightCap].Clone, rightList.ToArray());
 }
Пример #2
0
 protected void BatchAdd(Item item, Section[][] sectionBuilderList)
 {
     foreach (var sectionList in sectionBuilderList)
     {
         BatchAdd(item.Clone, sectionList);
     }
 }
Пример #3
0
 protected void BatchAdd(Item item1, Item item2, Section[] sectionList)
 {
     BatchAdd(item1, item2, null, null, null, sectionList);
 }
Пример #4
0
 protected void BatchAdd(Item item, Section[] sectionList)
 {
     ObjectData.Add(item, sectionList);
 }
Пример #5
0
 protected void BatchAdd(Item item1, Item item2, Item item3,
     Section[][] sectionBuilderList)
 {
     BatchAdd(item1, item2, item3, null, null, sectionBuilderList);
 }
Пример #6
0
 protected void BatchAdd(Item item1, Item item2, Item item3, Item item4, Item item5,
     Section[][] sectionBuilderList)
 {
     foreach (var sectionBuilder in sectionBuilderList)
     {
         BatchAdd(item1, item2, item3, item4, item5, sectionBuilder);
     }
 }