[Rem] Upper sum Text & upper bonus text | previewText & recordedScoreText (move to scoreText)
This commit is contained in:
@@ -12,13 +12,9 @@ namespace YachtDice.Categories
|
||||
public class CategoryCatalog : ScriptableObject
|
||||
{
|
||||
[SerializeField] private List<CategoryDefinition> categories = new();
|
||||
[SerializeField] private int upperBonusThreshold = 63;
|
||||
[SerializeField] private int upperBonusValue = 35;
|
||||
|
||||
public IReadOnlyList<CategoryDefinition> All => categories;
|
||||
public int Count => categories.Count;
|
||||
public int UpperBonusThreshold => upperBonusThreshold;
|
||||
public int UpperBonusValue => upperBonusValue;
|
||||
|
||||
public CategoryDefinition FindById(string id)
|
||||
{
|
||||
@@ -42,12 +38,10 @@ namespace YachtDice.Categories
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static CategoryCatalog CreateForTest(List<CategoryDefinition> defs, int upperBonusThreshold = 63, int upperBonusValue = 35)
|
||||
public static CategoryCatalog CreateForTest(List<CategoryDefinition> defs)
|
||||
{
|
||||
var catalog = CreateInstance<CategoryCatalog>();
|
||||
catalog.categories = defs ?? new List<CategoryDefinition>();
|
||||
catalog.upperBonusThreshold = upperBonusThreshold;
|
||||
catalog.upperBonusValue = upperBonusValue;
|
||||
return catalog;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -16,20 +16,16 @@ namespace YachtDice.Categories
|
||||
[field: SerializeField, TextArea] public string Description { get; private set; }
|
||||
[field: SerializeField] public Sprite Icon { get; private set; }
|
||||
|
||||
[field: Header("Section")]
|
||||
[field: SerializeField] public bool IsUpperSection { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Вычисляет очки для данного набора дайсов.
|
||||
/// </summary>
|
||||
public abstract int Calculate(IReadOnlyList<IDice> dice);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public void SetTestData(string testId, string testDisplayName, bool upperSection = false)
|
||||
public void SetTestData(string testId, string testDisplayName)
|
||||
{
|
||||
Id = testId;
|
||||
DisplayName = testDisplayName;
|
||||
IsUpperSection = upperSection;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace YachtDice.Categories
|
||||
public static MasterValueCategory CreateForTest(string id, string displayName, int targetValue, int categoryBonus = 0)
|
||||
{
|
||||
var so = CreateInstance<MasterValueCategory>();
|
||||
so.SetTestData(id, displayName, upperSection: true);
|
||||
so.SetTestData(id, displayName);
|
||||
so.TargetValue = targetValue;
|
||||
so.CategoryBonus = categoryBonus;
|
||||
return so;
|
||||
|
||||
@@ -5,7 +5,7 @@ using YachtDice.Dice;
|
||||
namespace YachtDice.Categories
|
||||
{
|
||||
/// <summary>
|
||||
/// Категория верхней секции: суммирует все дайсы с заданным значением.
|
||||
/// Категория, которая суммирует все дайсы с заданным значением.
|
||||
/// Используется для Единиц (1), Двоек (2), ... Шестёрок (6).
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "SumOfValueCategory", menuName = "YachtDice/Categories/Sum Of Value")]
|
||||
@@ -29,7 +29,7 @@ namespace YachtDice.Categories
|
||||
public static SumOfValueCategory CreateForTest(string id, string displayName, int target)
|
||||
{
|
||||
var so = CreateInstance<SumOfValueCategory>();
|
||||
so.SetTestData(id, displayName, upperSection: true);
|
||||
so.SetTestData(id, displayName);
|
||||
so.TargetValue = target;
|
||||
return so;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user