유닛 획득 count추가
This commit is contained in:
parent
e41f9ca3cf
commit
fc9ce60920
|
|
@ -173,22 +173,36 @@ namespace Server.Manager
|
||||||
|
|
||||||
public bool Add(DeckUnitInfo item)
|
public bool Add(DeckUnitInfo item)
|
||||||
{
|
{
|
||||||
if(_deckUnitInfo.FindIndex(n => n.unit_data_id == item.unit_data_id) != -1)
|
int index = _deckUnitInfo.FindIndex(n => n.unit_data_id == item.unit_data_id);
|
||||||
return false;
|
int addIndex = addDeckUnitInfo.FindIndex(n => n.unit_data_id == item.unit_data_id);
|
||||||
|
if (index == -1)
|
||||||
|
{
|
||||||
_deckUnitInfo.Add(item);
|
_deckUnitInfo.Add(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_deckUnitInfo[index].count += item.count;
|
||||||
|
item.id = _deckUnitInfo[index].id;
|
||||||
|
}
|
||||||
|
if (addIndex == -1)
|
||||||
|
{
|
||||||
addDeckUnitInfo.Add(item);
|
addDeckUnitInfo.Add(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDeckUnitInfo[index].count += item.count;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Add(List<DeckUnitInfo> items)
|
public bool Add(List<DeckUnitInfo> items)
|
||||||
{
|
{
|
||||||
foreach(var item in items)
|
foreach (DeckUnitInfo item in items)
|
||||||
{
|
{
|
||||||
if (_deckUnitInfo.FindIndex(n => n.unit_data_id == item.unit_data_id) != -1)
|
if (!Add(item))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_deckUnitInfo.AddRange(items);
|
|
||||||
addDeckUnitInfo.AddRange(items);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,8 +215,11 @@ namespace Server.Manager
|
||||||
|
|
||||||
public bool Add(List<Equipment> items)
|
public bool Add(List<Equipment> items)
|
||||||
{
|
{
|
||||||
_equipment.AddRange(items);
|
foreach (Equipment item in items)
|
||||||
addEquipment.AddRange(items);
|
{
|
||||||
|
if (!Add(item))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -234,25 +251,8 @@ namespace Server.Manager
|
||||||
{
|
{
|
||||||
foreach(ConsumableItem item in items)
|
foreach(ConsumableItem item in items)
|
||||||
{
|
{
|
||||||
int index = _consumableItem.FindIndex(n => n.consumable_item_data_id == item.consumable_item_data_id);
|
if (!Add(item))
|
||||||
int addIndex = addConsumableItem.FindIndex(n => n.consumable_item_data_id == item.consumable_item_data_id);
|
return false;
|
||||||
if (index == -1)
|
|
||||||
{
|
|
||||||
_consumableItem.Add(item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_consumableItem[index].count += item.count;
|
|
||||||
item.id = _consumableItem[index].id;
|
|
||||||
}
|
|
||||||
if (addIndex == -1)
|
|
||||||
{
|
|
||||||
addConsumableItem.Add(item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
addConsumableItem[index].count += item.count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -285,25 +285,8 @@ namespace Server.Manager
|
||||||
{
|
{
|
||||||
foreach (EtcItem item in items)
|
foreach (EtcItem item in items)
|
||||||
{
|
{
|
||||||
int index = _etcItem.FindIndex(n => n.etc_item_data_id == item.etc_item_data_id);
|
if (!Add(item))
|
||||||
int addIndex = addEtcItem.FindIndex(n => n.etc_item_data_id == item.etc_item_data_id);
|
return false;
|
||||||
if (index == -1)
|
|
||||||
{
|
|
||||||
_etcItem.Add(item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_etcItem[index].count += item.count;
|
|
||||||
item.id = _etcItem[index].id;
|
|
||||||
}
|
|
||||||
if (addIndex == -1)
|
|
||||||
{
|
|
||||||
addEtcItem.Add(item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
addEtcItem[index].count += item.count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ namespace Server.SQL
|
||||||
public long equip5_id { get; set; }
|
public long equip5_id { get; set; }
|
||||||
public int level { get; set; }
|
public int level { get; set; }
|
||||||
public long exp { get; set; }
|
public long exp { get; set; }
|
||||||
|
public long count { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeckUnitInfoSQL : SQL<DeckUnitInfo>
|
public class DeckUnitInfoSQL : SQL<DeckUnitInfo>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue