[Rename] Unify Die → Dice naming across the entire project

Standardize all class, interface, file, method, event, field, and variable
names from the inconsistent "Die" form to "Dice", matching the existing
DiceManager/DiceCatalog/DiceCollection convention.

Renamed files (7 + meta): IDie→IDice, DieInstance→DiceInstance,
DieDefinitionSO→DiceDefinitionSO, StandardDieSO→StandardDiceSO,
DieValueCondition→DiceValueCondition, AddPerDieEffect→AddPerDiceEffect,
MultiplyPerDieEffect→MultiplyPerDiceEffect.

Updated all 31 consumer and test files with matching reference changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 05:37:12 +07:00
parent f6c354d41c
commit 13b18b0a8b
39 changed files with 153 additions and 153 deletions
@@ -18,7 +18,7 @@ namespace YachtDice.Tests
[Test]
public void Add_IncreasesCount()
{
var die = StandardDieSO.CreateStandardD6ForTest();
var die = StandardDiceSO.CreateStandardD6ForTest();
collection.Add(die);
@@ -28,7 +28,7 @@ namespace YachtDice.Tests
[Test]
public void Add_DuplicateId_Ignored()
{
var die = StandardDieSO.CreateStandardD6ForTest();
var die = StandardDiceSO.CreateStandardD6ForTest();
collection.Add(die);
collection.Add(die);
@@ -47,7 +47,7 @@ namespace YachtDice.Tests
[Test]
public void OwnsById_ReturnsTrueWhenOwned()
{
var die = StandardDieSO.CreateStandardD6ForTest();
var die = StandardDiceSO.CreateStandardD6ForTest();
collection.Add(die);
@@ -63,7 +63,7 @@ namespace YachtDice.Tests
[Test]
public void Remove_DecreasesCount()
{
var die = StandardDieSO.CreateStandardD6ForTest();
var die = StandardDiceSO.CreateStandardD6ForTest();
collection.Add(die);
collection.Remove(die);
@@ -74,7 +74,7 @@ namespace YachtDice.Tests
[Test]
public void GetSaveData_ReturnsIds()
{
var die = StandardDieSO.CreateStandardD6ForTest();
var die = StandardDiceSO.CreateStandardD6ForTest();
collection.Add(die);
@@ -86,8 +86,8 @@ namespace YachtDice.Tests
[Test]
public void LoadSaveData_RestoresDice()
{
var die = StandardDieSO.CreateStandardD6ForTest();
var catalog = DiceCatalog.CreateForTest(new List<DieDefinitionSO> { die });
var die = StandardDiceSO.CreateStandardD6ForTest();
var catalog = DiceCatalog.CreateForTest(new List<DiceDefinitionSO> { die });
var ids = new List<string> { "standard_d6" };
collection.LoadSaveData(ids, catalog);
@@ -99,7 +99,7 @@ namespace YachtDice.Tests
[Test]
public void LoadSaveData_SkipsMissingIds()
{
var catalog = DiceCatalog.CreateForTest(new List<DieDefinitionSO>());
var catalog = DiceCatalog.CreateForTest(new List<DiceDefinitionSO>());
var ids = new List<string> { "nonexistent" };
collection.LoadSaveData(ids, catalog);
@@ -110,7 +110,7 @@ namespace YachtDice.Tests
[Test]
public void Clear_RemovesAll()
{
var die = StandardDieSO.CreateStandardD6ForTest();
var die = StandardDiceSO.CreateStandardD6ForTest();
collection.Add(die);
collection.Clear();
@@ -124,7 +124,7 @@ namespace YachtDice.Tests
bool fired = false;
collection.OnChanged += () => fired = true;
var die = StandardDieSO.CreateStandardD6ForTest();
var die = StandardDiceSO.CreateStandardD6ForTest();
collection.Add(die);
Assert.IsTrue(fired);
@@ -41,12 +41,12 @@ namespace YachtDice.Tests
};
}
// ── AddPerDieEffect ─────────────────────────────────────────
// ── AddPerDiceEffect ─────────────────────────────────────────
[Test]
public void AddPerDieEffect_CountsMatchingDice()
public void AddPerDiceEffect_CountsMatchingDice()
{
var effect = AddPerDieEffect.CreateForTest(10, targetDieValue: 1);
var effect = AddPerDiceEffect.CreateForTest(10, targetDiceValue: 1);
var ctx = CreateContext(5, new[] { 1, 1, 3, 4, 1 });
var inst = CreateInstance();
@@ -56,9 +56,9 @@ namespace YachtDice.Tests
}
[Test]
public void AddPerDieEffect_ZeroTarget_CountsAllDice()
public void AddPerDiceEffect_ZeroTarget_CountsAllDice()
{
var effect = AddPerDieEffect.CreateForTest(2, targetDieValue: 0);
var effect = AddPerDiceEffect.CreateForTest(2, targetDiceValue: 0);
var ctx = CreateContext(10, new[] { 1, 2, 3, 4, 5 });
var inst = CreateInstance();
@@ -68,9 +68,9 @@ namespace YachtDice.Tests
}
[Test]
public void AddPerDieEffect_NoMatches_ZeroBonus()
public void AddPerDiceEffect_NoMatches_ZeroBonus()
{
var effect = AddPerDieEffect.CreateForTest(10, targetDieValue: 6);
var effect = AddPerDiceEffect.CreateForTest(10, targetDiceValue: 6);
var ctx = CreateContext(5, new[] { 1, 2, 3, 4, 5 });
var inst = CreateInstance();
@@ -80,9 +80,9 @@ namespace YachtDice.Tests
}
[Test]
public void AddPerDieEffect_ScalesWithStacks()
public void AddPerDiceEffect_ScalesWithStacks()
{
var effect = AddPerDieEffect.CreateForTest(10, targetDieValue: 1);
var effect = AddPerDiceEffect.CreateForTest(10, targetDiceValue: 1);
var ctx = CreateContext(5, new[] { 1, 1, 3, 4, 1 });
var inst = CreateInstance();
inst.Stacks = 2;
@@ -119,12 +119,12 @@ namespace YachtDice.Tests
Assert.AreEqual(45, ctx.FlatBonus); // 15 * 3 stacks
}
// ── MultiplyPerDieEffect ────────────────────────────────────
// ── MultiplyPerDiceEffect ────────────────────────────────────
[Test]
public void MultiplyPerDieEffect_MultipliesPerMatch()
public void MultiplyPerDiceEffect_MultipliesPerMatch()
{
var effect = MultiplyPerDieEffect.CreateForTest(2f, targetDieValue: 6);
var effect = MultiplyPerDiceEffect.CreateForTest(2f, targetDiceValue: 6);
var ctx = CreateContext(18, new[] { 6, 6, 6, 1, 2 });
var inst = CreateInstance();
@@ -134,9 +134,9 @@ namespace YachtDice.Tests
}
[Test]
public void MultiplyPerDieEffect_NoMatches_MultiplierUnchanged()
public void MultiplyPerDiceEffect_NoMatches_MultiplierUnchanged()
{
var effect = MultiplyPerDieEffect.CreateForTest(3f, targetDieValue: 6);
var effect = MultiplyPerDiceEffect.CreateForTest(3f, targetDiceValue: 6);
var ctx = CreateContext(10, new[] { 1, 2, 3, 4, 5 });
var inst = CreateInstance();
@@ -186,8 +186,8 @@ namespace YachtDice.Tests
[Test]
public void Execute_MultipleModifiers_CorrectOrder()
{
var perDieAdd = AddPerDieEffect.CreateForTest(2, targetDieValue: 3, phase: ModifierPhase.Additive);
var perDieMul = MultiplyPerDieEffect.CreateForTest(1.5f, targetDieValue: 3, phase: ModifierPhase.Multiplicative);
var perDieAdd = AddPerDiceEffect.CreateForTest(2, targetDiceValue: 3, phase: ModifierPhase.Additive);
var perDieMul = MultiplyPerDiceEffect.CreateForTest(1.5f, targetDiceValue: 3, phase: ModifierPhase.Multiplicative);
var flatAdd = AddFlatScoreEffect.CreateForTest(10, ModifierPhase.Additive, priority: 10);
var finalMul = MultiplyScoreEffect.CreateForTest(2f, ModifierPhase.Multiplicative, priority: 10);
@@ -283,12 +283,12 @@ namespace YachtDice.Tests
Assert.IsTrue(result.DebugLog.Count > 0);
}
// ── DieValue Condition ──────────────────────────────────────
// ── DiceValue Condition ──────────────────────────────────────
[Test]
public void Execute_DieValueCondition_OnlyTriggersOnMatch()
public void Execute_DiceValueCondition_OnlyTriggersOnMatch()
{
var condition = DieValueCondition.CreateForTest(6, minCount: 3);
var condition = DiceValueCondition.CreateForTest(6, minCount: 3);
var effect = AddFlatScoreEffect.CreateForTest(100);
var def = CreateDef("sixes-bonus", TriggerType.OnCategoryScored,
@@ -14,12 +14,12 @@ namespace YachtDice.Tests
private CategoryDefinition twosCategory;
private CategoryDefinition chanceCategory;
private CategoryCatalog catalog;
private DieDefinitionSO standardDie;
private DiceDefinitionSO standardDice;
[SetUp]
public void SetUp()
{
standardDie = DieDefinitionSO.CreateForTest<StandardDieSO>("d6", "d6");
standardDice = DiceDefinitionSO.CreateForTest<StandardDiceSO>("d6", "d6");
yachtCategory = NOfAKindCategory.CreateForTest("yacht", "Яхта", 5, fixedScoreMode: true, score: 50);
onesCategory = SumOfValueCategory.CreateForTest("ones", "Единицы", 1);
@@ -43,7 +43,7 @@ namespace YachtDice.Tests
Object.DestroyImmediate(twosCategory);
Object.DestroyImmediate(chanceCategory);
Object.DestroyImmediate(catalog);
Object.DestroyImmediate(standardDie);
Object.DestroyImmediate(standardDice);
}
private ScoringSystem CreateScoringSystem()
@@ -52,11 +52,11 @@ namespace YachtDice.Tests
return go.AddComponent<ScoringSystem>();
}
private IReadOnlyList<IDie> CreateDice(params int[] values)
private IReadOnlyList<IDice> CreateDice(params int[] values)
{
var dice = new DieInstance[values.Length];
var dice = new DiceInstance[values.Length];
for (int i = 0; i < values.Length; i++)
dice[i] = new DieInstance(standardDie, values[i]);
dice[i] = new DiceInstance(standardDice, values[i]);
return dice;
}
@@ -140,9 +140,9 @@ namespace YachtDice.Tests
}
[Test]
public void TryPurchase_DieItem_AddsToDiceCollection()
public void TryPurchase_DiceItem_AddsToDiceCollection()
{
var die = DieDefinitionSO.CreateForTest<StandardDieSO>("test_die", shopPrice: 100);
var die = DiceDefinitionSO.CreateForTest<StandardDiceSO>("test_die", shopPrice: 100);
bool result = shop.TryPurchase(die);
@@ -152,9 +152,9 @@ namespace YachtDice.Tests
}
[Test]
public void TryPurchase_DieItem_CannotBeBoughtTwice()
public void TryPurchase_DiceItem_CannotBeBoughtTwice()
{
var die = DieDefinitionSO.CreateForTest<StandardDieSO>("unique_die", shopPrice: 100);
var die = DiceDefinitionSO.CreateForTest<StandardDiceSO>("unique_die", shopPrice: 100);
shop.TryPurchase(die);
bool secondResult = shop.TryPurchase(die);
@@ -165,9 +165,9 @@ namespace YachtDice.Tests
}
[Test]
public void GetItemState_Die_Owned_AfterPurchase()
public void GetItemState_Dice_Owned_AfterPurchase()
{
var die = DieDefinitionSO.CreateForTest<StandardDieSO>("die1", shopPrice: 50);
var die = DiceDefinitionSO.CreateForTest<StandardDiceSO>("die1", shopPrice: 50);
shop.TryPurchase(die);