[Fix] Refactor project

This commit is contained in:
2026-03-02 12:49:12 +07:00
parent f65976796d
commit f52131f755
44 changed files with 449 additions and 404 deletions
+8 -6
View File
@@ -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);
}