[Fix] Refactor project
This commit is contained in:
@@ -29,19 +29,21 @@ namespace YachtDice.Player
|
||||
|
||||
public bool OwnsById(string id)
|
||||
{
|
||||
for (int i = 0; i < _ownedDice.Count; i++)
|
||||
foreach (var t in _ownedDice)
|
||||
{
|
||||
if (_ownedDice[i] != null && _ownedDice[i].Id == id)
|
||||
if (t != null && t.Id == id)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<string> GetSaveData()
|
||||
{
|
||||
var ids = new List<string>();
|
||||
for (int i = 0; i < _ownedDice.Count; i++)
|
||||
ids.Add(_ownedDice[i].Id);
|
||||
foreach (var t in _ownedDice)
|
||||
ids.Add(t.Id);
|
||||
|
||||
return ids;
|
||||
}
|
||||
|
||||
@@ -55,9 +57,9 @@ namespace YachtDice.Player
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < diceIds.Count; i++)
|
||||
foreach (var t in diceIds)
|
||||
{
|
||||
var def = catalog.FindById(diceIds[i]);
|
||||
var def = catalog.FindById(t);
|
||||
if (def != null)
|
||||
_ownedDice.Add(def);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user