private void GetEffectedProps(EquipInShip[] euips) { this.equipEffectedProps = new Dictionary<ShipPropsType, bool>(); List<ShipPropsType> list3 = new List<ShipPropsType>(); list3.Add(ShipPropsType.Atk); list3.Add(ShipPropsType.Torpedo); list3.Add(ShipPropsType.AirDef); list3.Add(ShipPropsType.Antisub); list3.Add(ShipPropsType.Radar); list3.Add(ShipPropsType.Hit); list3.Add(ShipPropsType.Miss); list3.Add(ShipPropsType.Range); List<ShipPropsType> list = list3; for (int i = 0; i < euips.Length; i++) { if (euips[i] != null) { EquipmentConfig config = euips[i].config; if (config != null) { List<int> list4 = new List<int>(); list4.Add(config.atk); list4.Add(config.torpedo); list4.Add(config.airDef); list4.Add(config.antisub); list4.Add(config.radar); list4.Add(config.hit); list4.Add(config.miss); list4.Add(config.range); List<int> list2 = list4; for (int j = 0; j < list.Count; j++) { if (list2[j] != 0) { this.equipEffectedProps[list[j]] = true; } } } } } }
private void updateoneweapon(UserShip us, int index) { bool enableslot = index < us.equipmentArr.Length; if (enableslot == false) { return; } else { bool hasweapon = us.equipmentArr[index].id > 0; if (hasweapon) { weapons[index].Image = tools.helper.getShipEquipmentImage(us.equipmentArr[index].config); } else { weapons[index].Image = tools.helper.OpenImage("res/png/icons/weapon_add.png"); return; } } EquipInShip eip = us.equipmentArr[index]; if (us.capacitySlotExist[index] == 1) { weaponcount[index].Visible = true; weaponcount[index].Text = "" + us.capacitySlot[index] + "/" + us.capacitySlotMax[index]; } weaponname[index].Visible = true; weaponname[index].Text = eip.config.title.Length > 6? (eip.config.title.Substring(0, 6) + ".."):(eip.config.title.Length <= 3? (" " + eip.config.title):eip.config.title); List <int> vallist = new List <int> { eip.config.atk, eip.config.torpedo, eip.config.aircraftAtk, eip.config.airDef, eip.config.antisub, eip.config.radar, eip.config.hit, eip.config.miss, eip.config.range, eip.config.luck, eip.config.def }; int count = 0; List <BorderLabel> pnames = new List <BorderLabel>() { weaponprop1[index], weaponprop2[index], weaponprop3[index] }; List <BorderLabel> pvals = new List <BorderLabel>() { weaponprop1val[index], weaponprop2val[index], weaponprop3val[index] }; SortedDictionary <int, int> propdic = new SortedDictionary <int, int>(); for (int i = 0; (i < vallist.Count) && (count < 3); i++) { if (vallist[i] != 0) { pnames[count].Visible = true; pnames[count].Text = tools.helper.getShipProptypestring(type_order_list[i]); pvals[count].Visible = true; pvals[count].Text = tools.helper.getShipProptypeval(type_order_list[i], vallist[i]); count++; } } }