0f9b162061
- Add abstract dice system (IDie interface, DieDefinitionSO, StandardDieSO, DieInstance) to support future custom dice types while keeping backward compat via int[] DiceValues - Replace YachtCategory enum and CategoryScorer switch with CategoryDefinitionSO hierarchy: SumOfValueCategorySO, NOfAKindCategorySO, FullHouseCategorySO, StraightCategorySO, SumAllCategorySO - Add CategoryCatalogSO for ordered category collections and DiceCheckUtility for shared logic - Refactor ScoringSystem, Views, GameManager, GameController to use SO references - Update CategoryCondition modifier to use SO reference instead of enum - Update all editor tests to use SO-based categories and DieInstance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
808 B
C#
28 lines
808 B
C#
namespace YachtDice.Dice
|
|
{
|
|
/// <summary>
|
|
/// Рантайм-состояние одного дайса.
|
|
/// Хранит текущее значение верхней грани и ссылку на определение типа.
|
|
/// </summary>
|
|
public class DieInstance : IDie
|
|
{
|
|
public DieDefinitionSO Definition { get; }
|
|
public int Value { get; set; }
|
|
public bool IsLocked { get; set; }
|
|
|
|
public DieInstance(DieDefinitionSO definition)
|
|
{
|
|
Definition = definition;
|
|
Value = 0;
|
|
IsLocked = false;
|
|
}
|
|
|
|
public DieInstance(DieDefinitionSO definition, int initialValue)
|
|
{
|
|
Definition = definition;
|
|
Value = initialValue;
|
|
IsLocked = false;
|
|
}
|
|
}
|
|
}
|