[Fix] Code visual

This commit is contained in:
2026-02-28 19:25:26 +07:00
parent bee20fd1f8
commit e24b30743b
39 changed files with 2611 additions and 2687 deletions
+1 -2
View File
@@ -4,8 +4,7 @@ using UnityEngine;
namespace YachtDice.Dice
{
public sealed class Dice : MonoBehaviour
public class Dice : MonoBehaviour
{
[Serializable]
public struct Entry : IEquatable<Entry>
+1 -2
View File
@@ -5,12 +5,11 @@ using Random = UnityEngine.Random;
namespace YachtDice.Dice
{
/// <summary>
/// Красиво подбрасывает и раскручивает кубик, ждёт пока он остановится,
/// плавно доворачивает до ровного положения и сообщает результат.
/// </summary>
public sealed class DiceRoller : MonoBehaviour
public class DiceRoller : MonoBehaviour
{
[Header("References")]
[SerializeField] private Dice dice;
+1 -2
View File
@@ -3,8 +3,7 @@ using UnityEngine;
namespace YachtDice.Economy
{
public sealed class CurrencyBank : MonoBehaviour
public class CurrencyBank : MonoBehaviour
{
[SerializeField] private int startingBalance = 500;
-39
View File
@@ -1,39 +0,0 @@
using UnityEngine;
using YachtDice.Scoring;
namespace YachtDice.Game
{
public sealed class DebugGameInput : MonoBehaviour
{
[SerializeField] private GameManager gameManager;
private void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
gameManager.Roll();
// 1-5: toggle lock on dice 0-4
if (Input.GetKeyDown(KeyCode.Alpha1)) gameManager.ToggleDiceLock(0);
if (Input.GetKeyDown(KeyCode.Alpha2)) gameManager.ToggleDiceLock(1);
if (Input.GetKeyDown(KeyCode.Alpha3)) gameManager.ToggleDiceLock(2);
if (Input.GetKeyDown(KeyCode.Alpha4)) gameManager.ToggleDiceLock(3);
if (Input.GetKeyDown(KeyCode.Alpha5)) gameManager.ToggleDiceLock(4);
// Score categories
if (Input.GetKeyDown(KeyCode.F1)) gameManager.ScoreInCategory(YachtCategory.Ones);
if (Input.GetKeyDown(KeyCode.F2)) gameManager.ScoreInCategory(YachtCategory.Twos);
if (Input.GetKeyDown(KeyCode.F3)) gameManager.ScoreInCategory(YachtCategory.Threes);
if (Input.GetKeyDown(KeyCode.F4)) gameManager.ScoreInCategory(YachtCategory.Fours);
if (Input.GetKeyDown(KeyCode.F5)) gameManager.ScoreInCategory(YachtCategory.Fives);
if (Input.GetKeyDown(KeyCode.F6)) gameManager.ScoreInCategory(YachtCategory.Sixes);
if (Input.GetKeyDown(KeyCode.F7)) gameManager.ScoreInCategory(YachtCategory.ThreeOfAKind);
if (Input.GetKeyDown(KeyCode.F8)) gameManager.ScoreInCategory(YachtCategory.FourOfAKind);
if (Input.GetKeyDown(KeyCode.F9)) gameManager.ScoreInCategory(YachtCategory.FullHouse);
if (Input.GetKeyDown(KeyCode.F10)) gameManager.ScoreInCategory(YachtCategory.SmallStraight);
if (Input.GetKeyDown(KeyCode.F11)) gameManager.ScoreInCategory(YachtCategory.LargeStraight);
if (Input.GetKeyDown(KeyCode.F12)) gameManager.ScoreInCategory(YachtCategory.Yacht);
if (Input.GetKeyDown(KeyCode.C)) gameManager.ScoreInCategory(YachtCategory.Chance);
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 982f0996b85edfe419b07ddb36d6e235
+2 -3
View File
@@ -5,8 +5,7 @@ using YachtDice.Dice;
namespace YachtDice.Game
{
public sealed class DiceManager : MonoBehaviour
public class DiceManager : MonoBehaviour
{
[SerializeField] private List<DiceRoller> diceRollers = new();
@@ -99,7 +98,7 @@ public sealed class DiceManager : MonoBehaviour
{
for (int i = 0; i < diceRollers.Count; i++)
{
var diceComponent = diceRollers[i].GetComponent<Dice>();
var diceComponent = diceRollers[i].GetComponent<Dice.Dice>();
if (diceComponent != null && diceComponent.TryGetTopValue(out int val))
currentValues[i] = val;
}
+1 -2
View File
@@ -4,8 +4,7 @@ using YachtDice.Scoring;
namespace YachtDice.Game
{
public sealed class GameManager : MonoBehaviour
public class GameManager : MonoBehaviour
{
[Header("References")]
[SerializeField] private DiceManager diceManager;
@@ -5,8 +5,7 @@ using YachtDice.Scoring;
namespace YachtDice.Inventory
{
public sealed class InventoryController : MonoBehaviour
public class InventoryController : MonoBehaviour
{
[SerializeField] private InventoryView inventoryView;
[SerializeField] private ScoringSystem scoringSystem;
+1 -2
View File
@@ -4,8 +4,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Inventory
{
public sealed class InventoryModel
public class InventoryModel
{
private readonly List<ModifierRuntime> ownedModifiers = new();
private int maxActiveSlots;
@@ -6,8 +6,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Inventory
{
public sealed class InventorySlotView : MonoBehaviour
public class InventorySlotView : MonoBehaviour
{
[SerializeField] private Image iconImage;
[SerializeField] private TMP_Text nameText;
+1 -2
View File
@@ -7,8 +7,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Inventory
{
public sealed class InventoryView : MonoBehaviour
public class InventoryView : MonoBehaviour
{
[SerializeField] private Transform slotContainer;
[SerializeField] private InventorySlotView slotPrefab;
-1
View File
@@ -3,7 +3,6 @@ using YachtDice.Scoring;
namespace YachtDice.Modifiers
{
[CreateAssetMenu(fileName = "NewModifier", menuName = "YachtDice/Modifier Data")]
public sealed class ModifierData : ScriptableObject
{
@@ -3,7 +3,6 @@ using YachtDice.Scoring;
namespace YachtDice.Modifiers
{
public delegate void ModifierHandler(ModifierData data, ref ScoreResult result);
public static class ModifierEffect
@@ -3,7 +3,6 @@ using YachtDice.Scoring;
namespace YachtDice.Modifiers
{
public static class ModifierPipeline
{
// Application order (explicit):
+1 -2
View File
@@ -2,9 +2,8 @@ using System;
namespace YachtDice.Modifiers
{
[Serializable]
public sealed class ModifierRuntime
public class ModifierRuntime
{
public string ModifierId;
public bool IsActive;
@@ -4,7 +4,6 @@ using YachtDice.Scoring;
namespace YachtDice.Modifiers
{
[Serializable]
public struct ModifierTarget
{
-1
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
namespace YachtDice.Persistence
{
[Serializable]
public sealed class SaveData
{
-1
View File
@@ -3,7 +3,6 @@ using UnityEngine;
namespace YachtDice.Persistence
{
public static class SaveSystem
{
private const string SaveKey = "YachtDice_SaveData";
-1
View File
@@ -2,7 +2,6 @@ using System;
namespace YachtDice.Scoring
{
public static class CategoryScorer
{
public static int Calculate(int[] dice, YachtCategory category)
-1
View File
@@ -3,7 +3,6 @@ using UnityEngine;
namespace YachtDice.Scoring
{
[Serializable]
public struct ScoreResult
{
+1 -2
View File
@@ -5,8 +5,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Scoring
{
public sealed class ScoringSystem : MonoBehaviour
public class ScoringSystem : MonoBehaviour
{
public event Action<YachtCategory, int> OnCategoryScored;
public event Action<int> OnAllCategoriesScored;
-1
View File
@@ -4,7 +4,6 @@ using YachtDice.Modifiers;
namespace YachtDice.Shop
{
[CreateAssetMenu(fileName = "ShopCatalog", menuName = "YachtDice/Shop Catalog")]
public sealed class ShopCatalog : ScriptableObject
{
+1 -2
View File
@@ -4,8 +4,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Shop
{
public sealed class ShopController : MonoBehaviour
public class ShopController : MonoBehaviour
{
[SerializeField] private ShopCatalog catalog;
[SerializeField] private ShopView shopView;
+1 -2
View File
@@ -6,8 +6,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Shop
{
public sealed class ShopItemView : MonoBehaviour
public class ShopItemView : MonoBehaviour
{
[SerializeField] private Image iconImage;
[SerializeField] private TMP_Text nameText;
+1 -2
View File
@@ -6,8 +6,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Shop
{
public sealed class ShopModel
public class ShopModel
{
private readonly CurrencyBank currencyBank;
private readonly InventoryModel inventoryModel;
+1 -2
View File
@@ -7,8 +7,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Shop
{
public sealed class ShopView : MonoBehaviour
public class ShopView : MonoBehaviour
{
[SerializeField] private Transform itemContainer;
[SerializeField] private ShopItemView itemPrefab;
@@ -5,8 +5,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Tests
{
public sealed class InventoryModelTests
public class InventoryModelTests
{
private InventoryModel inventory;
@@ -5,8 +5,7 @@ using YachtDice.Scoring;
namespace YachtDice.Tests
{
public sealed class ModifierEffectTests
public class ModifierEffectTests
{
private static ModifierData CreateData(
ModifierEffectType effectType, float effectValue,
@@ -6,8 +6,7 @@ using YachtDice.Scoring;
namespace YachtDice.Tests
{
public sealed class ModifierPipelineTests
public class ModifierPipelineTests
{
[Test]
public void Apply_AdditiveBeforeMultiplicative()
@@ -5,8 +5,7 @@ using YachtDice.Persistence;
namespace YachtDice.Tests
{
public sealed class SaveSystemTests
public class SaveSystemTests
{
[SetUp]
public void SetUp()
@@ -6,8 +6,7 @@ using YachtDice.Modifiers;
namespace YachtDice.Tests
{
public sealed class ScoringSystemTests
public class ScoringSystemTests
{
private ScoringSystem CreateScoringSystem()
{
@@ -7,7 +7,6 @@ using YachtDice.Modifiers;
namespace YachtDice.Tests
{
public sealed class ShopModelTests
{
private CurrencyBank bank;
+1 -2
View File
@@ -6,8 +6,7 @@ using YachtDice.Scoring;
namespace YachtDice.UI
{
public sealed class CategoryRowView : MonoBehaviour
public class CategoryRowView : MonoBehaviour
{
[Header("UI Elements")]
[SerializeField] private TMP_Text categoryNameText;
+1 -2
View File
@@ -5,8 +5,7 @@ using TMPro;
namespace YachtDice.UI
{
public sealed class DicePanelView : MonoBehaviour
public class DicePanelView : MonoBehaviour
{
[Header("Dice Display")]
[SerializeField] private Button[] diceButtons = new Button[5];
+1 -2
View File
@@ -11,8 +11,7 @@ using YachtDice.Modifiers;
namespace YachtDice.UI
{
public sealed class GameController : MonoBehaviour
public class GameController : MonoBehaviour
{
[Header("Model")]
[SerializeField] private GameManager gameManager;
+1 -2
View File
@@ -5,8 +5,7 @@ using TMPro;
namespace YachtDice.UI
{
public sealed class GameInfoView : MonoBehaviour
public class GameInfoView : MonoBehaviour
{
[Header("Turn Info")]
[SerializeField] private TMP_Text turnText;
+1 -2
View File
@@ -6,8 +6,7 @@ using YachtDice.Scoring;
namespace YachtDice.UI
{
public sealed class ScoreCardView : MonoBehaviour
public class ScoreCardView : MonoBehaviour
{
[Header("Category Rows (in YachtCategory enum order)")]
[SerializeField] private List<CategoryRowView> categoryRows = new();