[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:
@@ -8,7 +8,7 @@ namespace YachtDice.Modifiers.Conditions
|
||||
[CreateAssetMenu(fileName = "DiceCountCondition", menuName = "YachtDice/Modifiers/Conditions/Dice Count")]
|
||||
public class DiceCountCondition : Condition
|
||||
{
|
||||
[Tooltip("Die face value to count (1-6). 0 = any value.")]
|
||||
[Tooltip("Dice face value to count (1-6). 0 = any value.")]
|
||||
[SerializeField, Range(0, 6)] private int targetValue;
|
||||
|
||||
[Tooltip("Minimum number of dice that must match.")]
|
||||
|
||||
+4
-4
@@ -5,8 +5,8 @@ using YachtDice.Modifiers.Runtime;
|
||||
|
||||
namespace YachtDice.Modifiers.Conditions
|
||||
{
|
||||
[CreateAssetMenu(fileName = "DieValueCondition", menuName = "YachtDice/Modifiers/Conditions/Die Value")]
|
||||
public class DieValueCondition : Condition
|
||||
[CreateAssetMenu(fileName = "DiceValueCondition", menuName = "YachtDice/Modifiers/Conditions/Dice Value")]
|
||||
public class DiceValueCondition : Condition
|
||||
{
|
||||
[SerializeField, Range(1, 6)] private int targetValue = 1;
|
||||
[SerializeField] private int minCount = 1;
|
||||
@@ -25,9 +25,9 @@ namespace YachtDice.Modifiers.Conditions
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static DieValueCondition CreateForTest(int targetValue, int minCount = 1)
|
||||
public static DiceValueCondition CreateForTest(int targetValue, int minCount = 1)
|
||||
{
|
||||
var so = CreateInstance<DieValueCondition>();
|
||||
var so = CreateInstance<DiceValueCondition>();
|
||||
so.targetValue = targetValue;
|
||||
so.minCount = minCount;
|
||||
return so;
|
||||
@@ -16,7 +16,7 @@ namespace YachtDice.Modifiers.Core
|
||||
public float PostMultiplier = 1f;
|
||||
|
||||
/// <summary>Абстрактные дайсы (основной API).</summary>
|
||||
public IReadOnlyList<IDie> Dice;
|
||||
public IReadOnlyList<IDice> Dice;
|
||||
|
||||
/// <summary>Значения дайсов (обратная совместимость с существующими модификаторами).</summary>
|
||||
public int[] DiceValues;
|
||||
@@ -55,7 +55,7 @@ namespace YachtDice.Modifiers.Core
|
||||
|
||||
public static ModifierContext CreateForScoring(
|
||||
int baseScore,
|
||||
IReadOnlyList<IDie> dice,
|
||||
IReadOnlyList<IDice> dice,
|
||||
CategoryDefinition category,
|
||||
int currentRoll,
|
||||
int currentTurn,
|
||||
|
||||
+12
-12
@@ -6,14 +6,14 @@ using YachtDice.Modifiers.Runtime;
|
||||
|
||||
namespace YachtDice.Modifiers.Effects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "AddPerDieEffect", menuName = "YachtDice/Modifiers/Effects/Add Per Die")]
|
||||
public class AddPerDieEffect : Effect
|
||||
[CreateAssetMenu(fileName = "AddPerDiceEffect", menuName = "YachtDice/Modifiers/Effects/Add Per Dice")]
|
||||
public class AddPerDiceEffect : Effect
|
||||
{
|
||||
[Tooltip("Points to add per matching die.")]
|
||||
[SerializeField] private int valuePerDie;
|
||||
[Tooltip("Points to add per matching dice.")]
|
||||
[SerializeField] private int valuePerDice;
|
||||
|
||||
[Tooltip("Die face value to match (1-6). 0 = any/all dice.")]
|
||||
[SerializeField, Range(0, 6)] private int targetDieValue;
|
||||
[Tooltip("Dice face value to match (1-6). 0 = any/all dice.")]
|
||||
[SerializeField, Range(0, 6)] private int targetDiceValue;
|
||||
|
||||
public override UniTask Apply(ModifierContext context, ModifierInstance instance)
|
||||
{
|
||||
@@ -22,21 +22,21 @@ namespace YachtDice.Modifiers.Effects
|
||||
int count = 0;
|
||||
for (int i = 0; i < context.DiceValues.Length; i++)
|
||||
{
|
||||
if (targetDieValue == 0 || context.DiceValues[i] == targetDieValue)
|
||||
if (targetDiceValue == 0 || context.DiceValues[i] == targetDiceValue)
|
||||
count++;
|
||||
}
|
||||
|
||||
context.FlatBonus += valuePerDie * count * instance.Stacks;
|
||||
context.FlatBonus += valuePerDice * count * instance.Stacks;
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static AddPerDieEffect CreateForTest(int valuePerDie, int targetDieValue = 0,
|
||||
public static AddPerDiceEffect CreateForTest(int valuePerDice, int targetDiceValue = 0,
|
||||
ModifierPhase phase = ModifierPhase.Additive, int priority = 0)
|
||||
{
|
||||
var so = CreateInstance<AddPerDieEffect>();
|
||||
so.valuePerDie = valuePerDie;
|
||||
so.targetDieValue = targetDieValue;
|
||||
var so = CreateInstance<AddPerDiceEffect>();
|
||||
so.valuePerDice = valuePerDice;
|
||||
so.targetDiceValue = targetDiceValue;
|
||||
so.SetPhaseForTest(phase);
|
||||
so.SetPriorityForTest(priority);
|
||||
return so;
|
||||
@@ -0,0 +1,44 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using YachtDice.Modifiers.Core;
|
||||
using YachtDice.Modifiers.Definition;
|
||||
using YachtDice.Modifiers.Runtime;
|
||||
|
||||
namespace YachtDice.Modifiers.Effects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "MultiplyPerDiceEffect", menuName = "YachtDice/Modifiers/Effects/Multiply Per Dice")]
|
||||
public class MultiplyPerDiceEffect : Effect
|
||||
{
|
||||
[Tooltip("Multiplier to apply per matching dice.")]
|
||||
[SerializeField] private float multiplierPerDice = 1f;
|
||||
|
||||
[Tooltip("Dice face value to match (1-6). 0 = any/all dice.")]
|
||||
[SerializeField, Range(0, 6)] private int targetDiceValue;
|
||||
|
||||
public override UniTask Apply(ModifierContext context, ModifierInstance instance)
|
||||
{
|
||||
if (context.DiceValues == null) return UniTask.CompletedTask;
|
||||
|
||||
for (int i = 0; i < context.DiceValues.Length; i++)
|
||||
{
|
||||
if (targetDiceValue == 0 || context.DiceValues[i] == targetDiceValue)
|
||||
context.Multiplier *= multiplierPerDice;
|
||||
}
|
||||
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static MultiplyPerDiceEffect CreateForTest(float multiplierPerDice, int targetDiceValue = 0,
|
||||
ModifierPhase phase = ModifierPhase.Multiplicative, int priority = 0)
|
||||
{
|
||||
var so = CreateInstance<MultiplyPerDiceEffect>();
|
||||
so.multiplierPerDice = multiplierPerDice;
|
||||
so.targetDiceValue = targetDiceValue;
|
||||
so.SetPhaseForTest(phase);
|
||||
so.SetPriorityForTest(priority);
|
||||
return so;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using YachtDice.Modifiers.Core;
|
||||
using YachtDice.Modifiers.Definition;
|
||||
using YachtDice.Modifiers.Runtime;
|
||||
|
||||
namespace YachtDice.Modifiers.Effects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "MultiplyPerDieEffect", menuName = "YachtDice/Modifiers/Effects/Multiply Per Die")]
|
||||
public class MultiplyPerDieEffect : Effect
|
||||
{
|
||||
[Tooltip("Multiplier to apply per matching die.")]
|
||||
[SerializeField] private float multiplierPerDie = 1f;
|
||||
|
||||
[Tooltip("Die face value to match (1-6). 0 = any/all dice.")]
|
||||
[SerializeField, Range(0, 6)] private int targetDieValue;
|
||||
|
||||
public override UniTask Apply(ModifierContext context, ModifierInstance instance)
|
||||
{
|
||||
if (context.DiceValues == null) return UniTask.CompletedTask;
|
||||
|
||||
for (int i = 0; i < context.DiceValues.Length; i++)
|
||||
{
|
||||
if (targetDieValue == 0 || context.DiceValues[i] == targetDieValue)
|
||||
context.Multiplier *= multiplierPerDie;
|
||||
}
|
||||
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static MultiplyPerDieEffect CreateForTest(float multiplierPerDie, int targetDieValue = 0,
|
||||
ModifierPhase phase = ModifierPhase.Multiplicative, int priority = 0)
|
||||
{
|
||||
var so = CreateInstance<MultiplyPerDieEffect>();
|
||||
so.multiplierPerDie = multiplierPerDie;
|
||||
so.targetDieValue = targetDieValue;
|
||||
so.SetPhaseForTest(phase);
|
||||
so.SetPriorityForTest(priority);
|
||||
return so;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user