private HashSet <int> ChargeDataSet_Onslot(enumHokyuType type, Mem_ship m_ship) { enumMaterialCategory key = enumMaterialCategory.Bauxite; int haveBauxite = Comm_UserDatas.Instance.User_material[key].Value; HashSet <int> hashSet = new HashSet <int>(); List <int> afterOnslot; if (haveBauxite == 0) { int haveBauxite2 = 100; int requireUseBauxiteNum = GetRequireUseBauxiteNum(m_ship, ref haveBauxite2, out afterOnslot); if (requireUseBauxiteNum > 0) { hashSet.Add(-2); } hashSet.Add(-1); return(hashSet); } int requireUseBauxiteNum2 = GetRequireUseBauxiteNum(m_ship, ref haveBauxite, out afterOnslot); m_ship.Set_ChargeData(m_ship.Bull, m_ship.Fuel, afterOnslot); Comm_UserDatas.Instance.User_material[key].Sub_Material(requireUseBauxiteNum2); List <int> maxeq = Mst_DataManager.Instance.Mst_ship[m_ship.Ship_id].Maxeq; for (int i = 0; i < m_ship.Slotnum; i++) { if (maxeq[i] > 0 && maxeq[i] != m_ship.Onslot[i]) { hashSet.Add(-2); } } return(hashSet); }
public void Set_ShipChargeData(int rid, int fuel, int bull, List <int> onslot) { Mem_ship value = null; if (Comm_UserDatas.Instance.User_ship.TryGetValue(rid, out value)) { value.Set_ChargeData(bull, fuel, onslot); } }
public void Set_ShipChargeData(int rid, int fuel, int bull, List <int> onslot) { Mem_ship mem_ship = null; if (!Comm_UserDatas.Instance.User_ship.TryGetValue(rid, ref mem_ship)) { return; } mem_ship.Set_ChargeData(bull, fuel, onslot); }
private bool ChargeDataSet(enumHokyuType type, Mem_ship m_ship) { enumMaterialCategory key; int value; int num; int fuel; int bull; switch (type) { case enumHokyuType.Fuel: { key = enumMaterialCategory.Fuel; int bull_max = Mst_DataManager.Instance.Mst_ship[m_ship.Ship_id].Fuel_max; value = Comm_UserDatas.Instance.User_material[key].Value; num = m_ship.GetRequireChargeFuel(); fuel = bull_max; bull = m_ship.Bull; break; } case enumHokyuType.Bull: { key = enumMaterialCategory.Bull; int bull_max = Mst_DataManager.Instance.Mst_ship[m_ship.Ship_id].Bull_max; value = Comm_UserDatas.Instance.User_material[key].Value; num = m_ship.GetRequireChargeBull(); fuel = m_ship.Fuel; bull = bull_max; break; } default: return(true); } if (value <= 0) { return(false); } if (num == 0) { return(true); } if (num > value) { return(true); } Comm_UserDatas.Instance.User_material[key].Sub_Material(num); m_ship.Set_ChargeData(bull, fuel, null); return(true); }
public static void DeckRefresh(int DeckID) { List <Mem_ship> memShip = Comm_UserDatas.Instance.User_deck.get_Item(DeckID).Ship.getMemShip(); using (List <Mem_ship> .Enumerator enumerator = memShip.GetEnumerator()) { while (enumerator.MoveNext()) { Mem_ship current = enumerator.get_Current(); current.SubHp(-(current.Maxhp - current.Nowhp)); Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship.get_Item(current.Ship_id); current.Set_ChargeData(mst_ship.Bull_max, mst_ship.Fuel_max, Enumerable.ToList <int>(mst_ship.Maxeq)); } } }
private bool ChargeDataSet(Api_req_Hokyu.enumHokyuType type, Mem_ship m_ship) { enumMaterialCategory enumMaterialCategory; int value; int num2; int fuel; int bull; if (type == Api_req_Hokyu.enumHokyuType.Fuel) { enumMaterialCategory = enumMaterialCategory.Fuel; int num = Mst_DataManager.Instance.Mst_ship.get_Item(m_ship.Ship_id).Fuel_max; value = Comm_UserDatas.Instance.User_material.get_Item(enumMaterialCategory).Value; num2 = m_ship.GetRequireChargeFuel(); fuel = num; bull = m_ship.Bull; } else { if (type != Api_req_Hokyu.enumHokyuType.Bull) { return(true); } enumMaterialCategory = enumMaterialCategory.Bull; int num = Mst_DataManager.Instance.Mst_ship.get_Item(m_ship.Ship_id).Bull_max; value = Comm_UserDatas.Instance.User_material.get_Item(enumMaterialCategory).Value; num2 = m_ship.GetRequireChargeBull(); fuel = m_ship.Fuel; bull = num; } if (value <= 0) { return(false); } if (num2 == 0) { return(true); } if (num2 > value) { return(true); } Comm_UserDatas.Instance.User_material.get_Item(enumMaterialCategory).Sub_Material(num2); m_ship.Set_ChargeData(bull, fuel, null); return(true); }
private HashSet <int> ChargeDataSet_Onslot(Api_req_Hokyu.enumHokyuType type, Mem_ship m_ship) { enumMaterialCategory enumMaterialCategory = enumMaterialCategory.Bauxite; int value = Comm_UserDatas.Instance.User_material.get_Item(enumMaterialCategory).Value; HashSet <int> hashSet = new HashSet <int>(); List <int> onslot; if (value == 0) { int num = 100; int requireUseBauxiteNum = this.GetRequireUseBauxiteNum(m_ship, ref num, out onslot); if (requireUseBauxiteNum > 0) { hashSet.Add(-2); } hashSet.Add(-1); return(hashSet); } int requireUseBauxiteNum2 = this.GetRequireUseBauxiteNum(m_ship, ref value, out onslot); m_ship.Set_ChargeData(m_ship.Bull, m_ship.Fuel, onslot); Comm_UserDatas.Instance.User_material.get_Item(enumMaterialCategory).Sub_Material(requireUseBauxiteNum2); List <int> maxeq = Mst_DataManager.Instance.Mst_ship.get_Item(m_ship.Ship_id).Maxeq; for (int i = 0; i < m_ship.Slotnum; i++) { if (maxeq.get_Item(i) > 0) { if (maxeq.get_Item(i) != m_ship.Onslot.get_Item(i)) { hashSet.Add(-2); } } } return(hashSet); }