private void GetEquipment(PlayerInfo pInfo) { Equipment = new Dictionary <string, BCMItemValue>(); var equipment = pInfo.EP != null?pInfo.EP.equipment.GetItems() : pInfo.PDF.equipment.GetItems(); var k = 1; var slotidx = new[] { 16, 9, 10, 27, 19, 3, 28, 29, 5, 6 }; foreach (var i in slotidx) { var item = equipment[i]; BCMItemValue slot = null; if (item.type != 0) { slot = new BCMItemValue(); if (item.ItemClass != null) { slot.UISlot = item.ItemClass.UmaSlotData.UISlot.ToString(); } slot.Type = item.type; slot.Quality = item.Quality; slot.UseTimes = item.UseTimes; slot.MaxUse = item.MaxUseTimes; slot.AmmoIndex = item.SelectedAmmoTypeIndex; if (item.Attachments != null && item.Attachments.Length > 0) { slot.Attachments = new List <BCMAttachment>(); foreach (var attachment in item.Attachments) { if (attachment != null && attachment.type != 0) { slot.Attachments.Add(new BCMAttachment(attachment)); } } } if (item.Parts != null && item.Parts.Length > 0) { slot.Parts = new List <BCMParts>(); foreach (var part in item.Parts) { if (part != null && part.type != 0) { slot.Parts.Add(new BCMParts(part)); } } } } Equipment.Add(k.ToString(), slot); k++; } Bin.Add("Equipment", Equipment); }
private void GetEquipment(PlayerInfo pInfo) { Equipment = new Dictionary <string, BCMItemValue>(); var equipment = pInfo.EP != null?pInfo.EP.equipment.GetItems() : pInfo.PDF.equipment.GetItems(); var k = 1; foreach (var item in equipment) { BCMItemValue slot = null; if (item.type != 0) { slot = new BCMItemValue(); if (item.ItemClass != null) { slot.UISlot = item.ItemClass.UmaSlotData.UISlot.ToString(); } slot.Type = item.type; slot.Quality = item.Quality; slot.UseTimes = item.UseTimes; slot.MaxUse = item.MaxUseTimes; slot.AmmoIndex = item.SelectedAmmoTypeIndex; if (item.Attachments != null && item.Attachments.Length > 0) { slot.Attachments = new List <BCMAttachment>(); foreach (var attachment in item.Attachments) { if (attachment != null && attachment.type != 0) { slot.Attachments.Add(new BCMAttachment { Type = attachment.type, Quality = attachment.Quality, MaxUse = attachment.MaxUseTimes, UseTimes = attachment.UseTimes }); } } } if (item.Parts != null && item.Parts.Length > 0) { slot.Parts = new List <BCMParts>(); foreach (var part in item.Parts) { if (part != null && part.type != 0) { slot.Parts.Add(new BCMParts { Type = part.type, Quality = part.Quality, MaxUse = part.MaxUseTimes, UseTimes = part.UseTimes }); } } } } Equipment.Add(k.ToString(), slot); k++; } Bin.Add("Equipment", Equipment); }