From bee20fd1f8c6c8d3780217f10d9841736e72a83b Mon Sep 17 00:00:00 2001 From: Konstantin Dyachenko Date: Sat, 28 Feb 2026 19:06:57 +0700 Subject: [PATCH] [Refactor] Add folder-based namespaces to all C# scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap all 39 scripts and 6 test files in namespaces matching their folder structure (e.g. Assets/Scripts/Dice/ → YachtDice.Dice). Add cross-namespace using directives where types are referenced across modules. Set rootNamespace in both .asmdef files (YachtDice, YachtDice.Tests). Namespace mapping: - YachtDice.Dice — Dice, DiceRoller - YachtDice.Economy — CurrencyBank - YachtDice.Game — GameManager, DiceManager, DebugGameInput - YachtDice.Inventory — InventoryController/Model/SlotView/View - YachtDice.Modifiers — ModifierData/Effect/Enums/Pipeline/Runtime/Target - YachtDice.Persistence — SaveData, SaveSystem - YachtDice.Scoring — CategoryScorer, ScoreResult, ScoringSystem, YachtCategory - YachtDice.Shop — ShopCatalog/Controller/ItemView/Model/View - YachtDice.UI — CategoryRowView, DicePanelView, GameController, GameInfoView, ScoreCardView - YachtDice.Editor — ModifierAssetCreator - YachtDice.Tests — all test files Co-Authored-By: Claude Opus 4.6 --- Assets/Editor/ModifierAssetCreator.cs | 7 +++++++ Assets/Scripts/Dice/Dice.cs | 6 +++++- Assets/Scripts/Dice/DiceRoller.cs | 4 ++++ Assets/Scripts/Economy/CurrencyBank.cs | 4 ++++ Assets/Scripts/Game/DebugGameInput.cs | 5 +++++ Assets/Scripts/Game/DiceManager.cs | 5 +++++ Assets/Scripts/Game/GameManager.cs | 5 +++++ Assets/Scripts/Inventory/InventoryController.cs | 7 +++++++ Assets/Scripts/Inventory/InventoryModel.cs | 5 +++++ Assets/Scripts/Inventory/InventorySlotView.cs | 5 +++++ Assets/Scripts/Inventory/InventoryView.cs | 5 +++++ Assets/Scripts/Modifiers/ModifierData.cs | 5 +++++ Assets/Scripts/Modifiers/ModifierEffect.cs | 5 +++++ Assets/Scripts/Modifiers/ModifierEnums.cs | 3 +++ Assets/Scripts/Modifiers/ModifierPipeline.cs | 5 +++++ Assets/Scripts/Modifiers/ModifierRuntime.cs | 4 ++++ Assets/Scripts/Modifiers/ModifierTarget.cs | 5 +++++ Assets/Scripts/Persistence/SaveData.cs | 4 ++++ Assets/Scripts/Persistence/SaveSystem.cs | 4 ++++ Assets/Scripts/Scoring/CategoryScorer.cs | 4 ++++ Assets/Scripts/Scoring/ScoreResult.cs | 4 ++++ Assets/Scripts/Scoring/ScoringSystem.cs | 5 +++++ Assets/Scripts/Scoring/YachtCategory.cs | 3 +++ Assets/Scripts/Shop/ShopCatalog.cs | 5 +++++ Assets/Scripts/Shop/ShopController.cs | 6 ++++++ Assets/Scripts/Shop/ShopItemView.cs | 5 +++++ Assets/Scripts/Shop/ShopModel.cs | 7 +++++++ Assets/Scripts/Shop/ShopView.cs | 5 +++++ Assets/Scripts/Tests/Editor/InventoryModelTests.cs | 6 ++++++ Assets/Scripts/Tests/Editor/ModifierEffectTests.cs | 6 ++++++ Assets/Scripts/Tests/Editor/ModifierPipelineTests.cs | 6 ++++++ Assets/Scripts/Tests/Editor/SaveSystemTests.cs | 5 +++++ Assets/Scripts/Tests/Editor/ScoringSystemTests.cs | 6 ++++++ Assets/Scripts/Tests/Editor/ShopModelTests.cs | 8 ++++++++ .../Tests/Editor/YachtDice.Tests.Editor.asmdef | 2 +- Assets/Scripts/UI/CategoryRowView.cs | 5 +++++ Assets/Scripts/UI/DicePanelView.cs | 4 ++++ Assets/Scripts/UI/GameController.cs | 11 +++++++++++ Assets/Scripts/UI/GameInfoView.cs | 4 ++++ Assets/Scripts/UI/ScoreCardView.cs | 5 +++++ Assets/Scripts/YachtDice.Runtime.asmdef | 2 +- 41 files changed, 204 insertions(+), 3 deletions(-) diff --git a/Assets/Editor/ModifierAssetCreator.cs b/Assets/Editor/ModifierAssetCreator.cs index 36e667f..f5d93db 100644 --- a/Assets/Editor/ModifierAssetCreator.cs +++ b/Assets/Editor/ModifierAssetCreator.cs @@ -1,6 +1,12 @@ #if UNITY_EDITOR using UnityEditor; using UnityEngine; +using YachtDice.Modifiers; +using YachtDice.Scoring; +using YachtDice.Shop; + +namespace YachtDice.Editor +{ public static class ModifierAssetCreator { @@ -120,4 +126,5 @@ public static class ModifierAssetCreator } } } +} #endif diff --git a/Assets/Scripts/Dice/Dice.cs b/Assets/Scripts/Dice/Dice.cs index 9f3fd87..9da3256 100644 --- a/Assets/Scripts/Dice/Dice.cs +++ b/Assets/Scripts/Dice/Dice.cs @@ -2,6 +2,9 @@ using System; using System.Collections.Generic; using UnityEngine; +namespace YachtDice.Dice +{ + public sealed class Dice : MonoBehaviour { [Serializable] @@ -134,4 +137,5 @@ public sealed class Dice : MonoBehaviour var e = transform.localEulerAngles; transform.localEulerAngles = new Vector3(Norm180(e.x), Norm180(e.y), Norm180(e.z)); } -} \ No newline at end of file +} +} diff --git a/Assets/Scripts/Dice/DiceRoller.cs b/Assets/Scripts/Dice/DiceRoller.cs index e0fc295..704727f 100644 --- a/Assets/Scripts/Dice/DiceRoller.cs +++ b/Assets/Scripts/Dice/DiceRoller.cs @@ -3,6 +3,9 @@ using System.Collections; using UnityEngine; using Random = UnityEngine.Random; +namespace YachtDice.Dice +{ + /// /// Красиво подбрасывает и раскручивает кубик, ждёт пока он остановится, /// плавно доворачивает до ровного положения и сообщает результат. @@ -150,3 +153,4 @@ public sealed class DiceRoller : MonoBehaviour // Debug.Log($"{gameObject.name} | Выпало: {topValue}"); } } +} diff --git a/Assets/Scripts/Economy/CurrencyBank.cs b/Assets/Scripts/Economy/CurrencyBank.cs index 27cb60a..a6b9cbd 100644 --- a/Assets/Scripts/Economy/CurrencyBank.cs +++ b/Assets/Scripts/Economy/CurrencyBank.cs @@ -1,6 +1,9 @@ using System; using UnityEngine; +namespace YachtDice.Economy +{ + public sealed class CurrencyBank : MonoBehaviour { [SerializeField] private int startingBalance = 500; @@ -42,3 +45,4 @@ public sealed class CurrencyBank : MonoBehaviour OnBalanceChanged?.Invoke(balance); } } +} diff --git a/Assets/Scripts/Game/DebugGameInput.cs b/Assets/Scripts/Game/DebugGameInput.cs index f1b520f..06c9ce1 100644 --- a/Assets/Scripts/Game/DebugGameInput.cs +++ b/Assets/Scripts/Game/DebugGameInput.cs @@ -1,4 +1,8 @@ using UnityEngine; +using YachtDice.Scoring; + +namespace YachtDice.Game +{ public sealed class DebugGameInput : MonoBehaviour { @@ -32,3 +36,4 @@ public sealed class DebugGameInput : MonoBehaviour if (Input.GetKeyDown(KeyCode.C)) gameManager.ScoreInCategory(YachtCategory.Chance); } } +} diff --git a/Assets/Scripts/Game/DiceManager.cs b/Assets/Scripts/Game/DiceManager.cs index 44b624f..996e07e 100644 --- a/Assets/Scripts/Game/DiceManager.cs +++ b/Assets/Scripts/Game/DiceManager.cs @@ -1,6 +1,10 @@ using System; using System.Collections.Generic; using UnityEngine; +using YachtDice.Dice; + +namespace YachtDice.Game +{ public sealed class DiceManager : MonoBehaviour { @@ -101,3 +105,4 @@ public sealed class DiceManager : MonoBehaviour } } } +} diff --git a/Assets/Scripts/Game/GameManager.cs b/Assets/Scripts/Game/GameManager.cs index 0f2447e..76bfdcd 100644 --- a/Assets/Scripts/Game/GameManager.cs +++ b/Assets/Scripts/Game/GameManager.cs @@ -1,5 +1,9 @@ using System; using UnityEngine; +using YachtDice.Scoring; + +namespace YachtDice.Game +{ public sealed class GameManager : MonoBehaviour { @@ -98,3 +102,4 @@ public sealed class GameManager : MonoBehaviour } } } +} diff --git a/Assets/Scripts/Inventory/InventoryController.cs b/Assets/Scripts/Inventory/InventoryController.cs index b87ecbb..f596635 100644 --- a/Assets/Scripts/Inventory/InventoryController.cs +++ b/Assets/Scripts/Inventory/InventoryController.cs @@ -1,4 +1,10 @@ using UnityEngine; +using YachtDice.Economy; +using YachtDice.Modifiers; +using YachtDice.Scoring; + +namespace YachtDice.Inventory +{ public sealed class InventoryController : MonoBehaviour { @@ -89,3 +95,4 @@ public sealed class InventoryController : MonoBehaviour inventoryView.Refresh(model.OwnedModifiers, model.MaxActiveSlots); } } +} diff --git a/Assets/Scripts/Inventory/InventoryModel.cs b/Assets/Scripts/Inventory/InventoryModel.cs index 4c521a6..ab11621 100644 --- a/Assets/Scripts/Inventory/InventoryModel.cs +++ b/Assets/Scripts/Inventory/InventoryModel.cs @@ -1,5 +1,9 @@ using System; using System.Collections.Generic; +using YachtDice.Modifiers; + +namespace YachtDice.Inventory +{ public sealed class InventoryModel { @@ -125,3 +129,4 @@ public sealed class InventoryModel public List GetAllForSave() => new(ownedModifiers); } +} diff --git a/Assets/Scripts/Inventory/InventorySlotView.cs b/Assets/Scripts/Inventory/InventorySlotView.cs index 64e2ef0..c48b180 100644 --- a/Assets/Scripts/Inventory/InventorySlotView.cs +++ b/Assets/Scripts/Inventory/InventorySlotView.cs @@ -2,6 +2,10 @@ using System; using TMPro; using UnityEngine; using UnityEngine.UI; +using YachtDice.Modifiers; + +namespace YachtDice.Inventory +{ public sealed class InventorySlotView : MonoBehaviour { @@ -76,3 +80,4 @@ public sealed class InventorySlotView : MonoBehaviour background.color = isActive ? activeColor : inactiveColor; } } +} diff --git a/Assets/Scripts/Inventory/InventoryView.cs b/Assets/Scripts/Inventory/InventoryView.cs index 8468a9c..269c878 100644 --- a/Assets/Scripts/Inventory/InventoryView.cs +++ b/Assets/Scripts/Inventory/InventoryView.cs @@ -3,6 +3,10 @@ using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; +using YachtDice.Modifiers; + +namespace YachtDice.Inventory +{ public sealed class InventoryView : MonoBehaviour { @@ -72,3 +76,4 @@ public sealed class InventoryView : MonoBehaviour private void HandleDeactivate(ModifierRuntime runtime) => OnDeactivateClicked?.Invoke(runtime); private void HandleSell(ModifierRuntime runtime) => OnSellClicked?.Invoke(runtime); } +} diff --git a/Assets/Scripts/Modifiers/ModifierData.cs b/Assets/Scripts/Modifiers/ModifierData.cs index 05b9a0c..7ad5cc9 100644 --- a/Assets/Scripts/Modifiers/ModifierData.cs +++ b/Assets/Scripts/Modifiers/ModifierData.cs @@ -1,4 +1,8 @@ using UnityEngine; +using YachtDice.Scoring; + +namespace YachtDice.Modifiers +{ [CreateAssetMenu(fileName = "NewModifier", menuName = "YachtDice/Modifier Data")] public sealed class ModifierData : ScriptableObject @@ -86,3 +90,4 @@ public sealed class ModifierData : ScriptableObject } #endif } +} diff --git a/Assets/Scripts/Modifiers/ModifierEffect.cs b/Assets/Scripts/Modifiers/ModifierEffect.cs index 4f3b0aa..a59db66 100644 --- a/Assets/Scripts/Modifiers/ModifierEffect.cs +++ b/Assets/Scripts/Modifiers/ModifierEffect.cs @@ -1,4 +1,8 @@ using System.Collections.Generic; +using YachtDice.Scoring; + +namespace YachtDice.Modifiers +{ public delegate void ModifierHandler(ModifierData data, ref ScoreResult result); @@ -53,3 +57,4 @@ public static class ModifierEffect result.Multiplier *= data.EffectValue; } } +} diff --git a/Assets/Scripts/Modifiers/ModifierEnums.cs b/Assets/Scripts/Modifiers/ModifierEnums.cs index d4db390..3d5e8d3 100644 --- a/Assets/Scripts/Modifiers/ModifierEnums.cs +++ b/Assets/Scripts/Modifiers/ModifierEnums.cs @@ -1,3 +1,5 @@ +namespace YachtDice.Modifiers +{ public enum ModifierScope { SelectedCategory, @@ -25,3 +27,4 @@ public enum ModifierRarity Rare, Epic } +} diff --git a/Assets/Scripts/Modifiers/ModifierPipeline.cs b/Assets/Scripts/Modifiers/ModifierPipeline.cs index 673f2b2..f90772b 100644 --- a/Assets/Scripts/Modifiers/ModifierPipeline.cs +++ b/Assets/Scripts/Modifiers/ModifierPipeline.cs @@ -1,4 +1,8 @@ using System.Collections.Generic; +using YachtDice.Scoring; + +namespace YachtDice.Modifiers +{ public static class ModifierPipeline { @@ -60,3 +64,4 @@ public static class ModifierPipeline return true; } } +} diff --git a/Assets/Scripts/Modifiers/ModifierRuntime.cs b/Assets/Scripts/Modifiers/ModifierRuntime.cs index bfb0be6..c89fb4a 100644 --- a/Assets/Scripts/Modifiers/ModifierRuntime.cs +++ b/Assets/Scripts/Modifiers/ModifierRuntime.cs @@ -1,5 +1,8 @@ using System; +namespace YachtDice.Modifiers +{ + [Serializable] public sealed class ModifierRuntime { @@ -32,3 +35,4 @@ public sealed class ModifierRuntime }; } } +} diff --git a/Assets/Scripts/Modifiers/ModifierTarget.cs b/Assets/Scripts/Modifiers/ModifierTarget.cs index a64eafb..72e399b 100644 --- a/Assets/Scripts/Modifiers/ModifierTarget.cs +++ b/Assets/Scripts/Modifiers/ModifierTarget.cs @@ -1,5 +1,9 @@ using System; using UnityEngine; +using YachtDice.Scoring; + +namespace YachtDice.Modifiers +{ [Serializable] public struct ModifierTarget @@ -14,3 +18,4 @@ public struct ModifierTarget [Tooltip("If true, TargetCategory is used as a filter.")] public bool HasCategoryFilter; } +} diff --git a/Assets/Scripts/Persistence/SaveData.cs b/Assets/Scripts/Persistence/SaveData.cs index 22b18f8..43365b9 100644 --- a/Assets/Scripts/Persistence/SaveData.cs +++ b/Assets/Scripts/Persistence/SaveData.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +namespace YachtDice.Persistence +{ + [Serializable] public sealed class SaveData { @@ -16,3 +19,4 @@ public sealed class ModifierSaveEntry public bool IsActive; public int RemainingUses; } +} diff --git a/Assets/Scripts/Persistence/SaveSystem.cs b/Assets/Scripts/Persistence/SaveSystem.cs index e661639..43c3b5a 100644 --- a/Assets/Scripts/Persistence/SaveSystem.cs +++ b/Assets/Scripts/Persistence/SaveSystem.cs @@ -1,6 +1,9 @@ using Newtonsoft.Json; using UnityEngine; +namespace YachtDice.Persistence +{ + public static class SaveSystem { private const string SaveKey = "YachtDice_SaveData"; @@ -40,3 +43,4 @@ public static class SaveSystem return PlayerPrefs.HasKey(SaveKey); } } +} diff --git a/Assets/Scripts/Scoring/CategoryScorer.cs b/Assets/Scripts/Scoring/CategoryScorer.cs index 3be8ca2..6763ad5 100644 --- a/Assets/Scripts/Scoring/CategoryScorer.cs +++ b/Assets/Scripts/Scoring/CategoryScorer.cs @@ -1,5 +1,8 @@ using System; +namespace YachtDice.Scoring +{ + public static class CategoryScorer { public static int Calculate(int[] dice, YachtCategory category) @@ -77,3 +80,4 @@ public static class CategoryScorer return false; } } +} diff --git a/Assets/Scripts/Scoring/ScoreResult.cs b/Assets/Scripts/Scoring/ScoreResult.cs index f851d00..154d30f 100644 --- a/Assets/Scripts/Scoring/ScoreResult.cs +++ b/Assets/Scripts/Scoring/ScoreResult.cs @@ -1,6 +1,9 @@ using System; using UnityEngine; +namespace YachtDice.Scoring +{ + [Serializable] public struct ScoreResult { @@ -24,3 +27,4 @@ public struct ScoreResult }; } } +} diff --git a/Assets/Scripts/Scoring/ScoringSystem.cs b/Assets/Scripts/Scoring/ScoringSystem.cs index e52126c..090ae63 100644 --- a/Assets/Scripts/Scoring/ScoringSystem.cs +++ b/Assets/Scripts/Scoring/ScoringSystem.cs @@ -1,6 +1,10 @@ using System; using System.Collections.Generic; using UnityEngine; +using YachtDice.Modifiers; + +namespace YachtDice.Scoring +{ public sealed class ScoringSystem : MonoBehaviour { @@ -82,3 +86,4 @@ public sealed class ScoringSystem : MonoBehaviour usedCategories.Clear(); } } +} diff --git a/Assets/Scripts/Scoring/YachtCategory.cs b/Assets/Scripts/Scoring/YachtCategory.cs index e9a7620..030b132 100644 --- a/Assets/Scripts/Scoring/YachtCategory.cs +++ b/Assets/Scripts/Scoring/YachtCategory.cs @@ -1,3 +1,5 @@ +namespace YachtDice.Scoring +{ public enum YachtCategory { // Upper Section @@ -17,3 +19,4 @@ public enum YachtCategory Yacht, Chance } +} diff --git a/Assets/Scripts/Shop/ShopCatalog.cs b/Assets/Scripts/Shop/ShopCatalog.cs index 8916c51..0447cb7 100644 --- a/Assets/Scripts/Shop/ShopCatalog.cs +++ b/Assets/Scripts/Shop/ShopCatalog.cs @@ -1,5 +1,9 @@ using System.Collections.Generic; using UnityEngine; +using YachtDice.Modifiers; + +namespace YachtDice.Shop +{ [CreateAssetMenu(fileName = "ShopCatalog", menuName = "YachtDice/Shop Catalog")] public sealed class ShopCatalog : ScriptableObject @@ -18,3 +22,4 @@ public sealed class ShopCatalog : ScriptableObject return null; } } +} diff --git a/Assets/Scripts/Shop/ShopController.cs b/Assets/Scripts/Shop/ShopController.cs index 4680fbc..d0bbb97 100644 --- a/Assets/Scripts/Shop/ShopController.cs +++ b/Assets/Scripts/Shop/ShopController.cs @@ -1,4 +1,9 @@ using UnityEngine; +using YachtDice.Economy; +using YachtDice.Modifiers; + +namespace YachtDice.Shop +{ public sealed class ShopController : MonoBehaviour { @@ -53,3 +58,4 @@ public sealed class ShopController : MonoBehaviour shopView.RefreshStates(catalog.AvailableModifiers, model); } } +} diff --git a/Assets/Scripts/Shop/ShopItemView.cs b/Assets/Scripts/Shop/ShopItemView.cs index db0ecc5..c2be2ab 100644 --- a/Assets/Scripts/Shop/ShopItemView.cs +++ b/Assets/Scripts/Shop/ShopItemView.cs @@ -2,6 +2,10 @@ using System; using TMPro; using UnityEngine; using UnityEngine.UI; +using YachtDice.Modifiers; + +namespace YachtDice.Shop +{ public sealed class ShopItemView : MonoBehaviour { @@ -85,3 +89,4 @@ public sealed class ShopItemView : MonoBehaviour }; } } +} diff --git a/Assets/Scripts/Shop/ShopModel.cs b/Assets/Scripts/Shop/ShopModel.cs index 676e217..f8a56c9 100644 --- a/Assets/Scripts/Shop/ShopModel.cs +++ b/Assets/Scripts/Shop/ShopModel.cs @@ -1,5 +1,11 @@ using System; using System.Collections.Generic; +using YachtDice.Economy; +using YachtDice.Inventory; +using YachtDice.Modifiers; + +namespace YachtDice.Shop +{ public sealed class ShopModel { @@ -76,3 +82,4 @@ public enum ShopItemState Owned, RepurchaseAvailable } +} diff --git a/Assets/Scripts/Shop/ShopView.cs b/Assets/Scripts/Shop/ShopView.cs index 25e8394..44f3f3c 100644 --- a/Assets/Scripts/Shop/ShopView.cs +++ b/Assets/Scripts/Shop/ShopView.cs @@ -3,6 +3,10 @@ using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; +using YachtDice.Modifiers; + +namespace YachtDice.Shop +{ public sealed class ShopView : MonoBehaviour { @@ -75,3 +79,4 @@ public sealed class ShopView : MonoBehaviour private void HandleBuy(ModifierData data) => OnBuyClicked?.Invoke(data); } +} diff --git a/Assets/Scripts/Tests/Editor/InventoryModelTests.cs b/Assets/Scripts/Tests/Editor/InventoryModelTests.cs index 9eeb256..a80b586 100644 --- a/Assets/Scripts/Tests/Editor/InventoryModelTests.cs +++ b/Assets/Scripts/Tests/Editor/InventoryModelTests.cs @@ -1,5 +1,10 @@ using NUnit.Framework; using UnityEngine; +using YachtDice.Inventory; +using YachtDice.Modifiers; + +namespace YachtDice.Tests +{ public sealed class InventoryModelTests { @@ -153,3 +158,4 @@ public sealed class InventoryModelTests Assert.IsTrue(fired); } } +} diff --git a/Assets/Scripts/Tests/Editor/ModifierEffectTests.cs b/Assets/Scripts/Tests/Editor/ModifierEffectTests.cs index fe26e77..cae584f 100644 --- a/Assets/Scripts/Tests/Editor/ModifierEffectTests.cs +++ b/Assets/Scripts/Tests/Editor/ModifierEffectTests.cs @@ -1,5 +1,10 @@ using NUnit.Framework; using UnityEngine; +using YachtDice.Modifiers; +using YachtDice.Scoring; + +namespace YachtDice.Tests +{ public sealed class ModifierEffectTests { @@ -87,3 +92,4 @@ public sealed class ModifierEffectTests Assert.AreEqual(1.5f, result.Multiplier, 0.001f); } } +} diff --git a/Assets/Scripts/Tests/Editor/ModifierPipelineTests.cs b/Assets/Scripts/Tests/Editor/ModifierPipelineTests.cs index 2658ba6..5d888cc 100644 --- a/Assets/Scripts/Tests/Editor/ModifierPipelineTests.cs +++ b/Assets/Scripts/Tests/Editor/ModifierPipelineTests.cs @@ -1,6 +1,11 @@ using System.Collections.Generic; using NUnit.Framework; using UnityEngine; +using YachtDice.Modifiers; +using YachtDice.Scoring; + +namespace YachtDice.Tests +{ public sealed class ModifierPipelineTests { @@ -134,3 +139,4 @@ public sealed class ModifierPipelineTests Assert.AreEqual(10, result.FinalScore); } } +} diff --git a/Assets/Scripts/Tests/Editor/SaveSystemTests.cs b/Assets/Scripts/Tests/Editor/SaveSystemTests.cs index c5be098..136daf2 100644 --- a/Assets/Scripts/Tests/Editor/SaveSystemTests.cs +++ b/Assets/Scripts/Tests/Editor/SaveSystemTests.cs @@ -1,6 +1,10 @@ using System.Collections.Generic; using NUnit.Framework; using UnityEngine; +using YachtDice.Persistence; + +namespace YachtDice.Tests +{ public sealed class SaveSystemTests { @@ -86,3 +90,4 @@ public sealed class SaveSystemTests Assert.AreEqual(0, loaded.Currency); } } +} diff --git a/Assets/Scripts/Tests/Editor/ScoringSystemTests.cs b/Assets/Scripts/Tests/Editor/ScoringSystemTests.cs index f85cd19..6f94d54 100644 --- a/Assets/Scripts/Tests/Editor/ScoringSystemTests.cs +++ b/Assets/Scripts/Tests/Editor/ScoringSystemTests.cs @@ -1,6 +1,11 @@ using System.Collections.Generic; using NUnit.Framework; using UnityEngine; +using YachtDice.Scoring; +using YachtDice.Modifiers; + +namespace YachtDice.Tests +{ public sealed class ScoringSystemTests { @@ -96,3 +101,4 @@ public sealed class ScoringSystemTests Assert.AreEqual(50, result.FinalScore); } } +} diff --git a/Assets/Scripts/Tests/Editor/ShopModelTests.cs b/Assets/Scripts/Tests/Editor/ShopModelTests.cs index 93c17ed..cf920d6 100644 --- a/Assets/Scripts/Tests/Editor/ShopModelTests.cs +++ b/Assets/Scripts/Tests/Editor/ShopModelTests.cs @@ -1,5 +1,12 @@ using NUnit.Framework; using UnityEngine; +using YachtDice.Economy; +using YachtDice.Inventory; +using YachtDice.Shop; +using YachtDice.Modifiers; + +namespace YachtDice.Tests +{ public sealed class ShopModelTests { @@ -128,3 +135,4 @@ public sealed class ShopModelTests Assert.AreEqual(ShopItemState.Owned, shop.GetItemState(mod)); } } +} diff --git a/Assets/Scripts/Tests/Editor/YachtDice.Tests.Editor.asmdef b/Assets/Scripts/Tests/Editor/YachtDice.Tests.Editor.asmdef index 745698e..c1a6c5d 100644 --- a/Assets/Scripts/Tests/Editor/YachtDice.Tests.Editor.asmdef +++ b/Assets/Scripts/Tests/Editor/YachtDice.Tests.Editor.asmdef @@ -1,6 +1,6 @@ { "name": "YachtDice.Tests.Editor", - "rootNamespace": "", + "rootNamespace": "YachtDice.Tests", "references": [ "UnityEngine.TestRunner", "UnityEditor.TestRunner", diff --git a/Assets/Scripts/UI/CategoryRowView.cs b/Assets/Scripts/UI/CategoryRowView.cs index fefda2b..98ed4e1 100644 --- a/Assets/Scripts/UI/CategoryRowView.cs +++ b/Assets/Scripts/UI/CategoryRowView.cs @@ -2,6 +2,10 @@ using System; using UnityEngine; using UnityEngine.UI; using TMPro; +using YachtDice.Scoring; + +namespace YachtDice.UI +{ public sealed class CategoryRowView : MonoBehaviour { @@ -87,3 +91,4 @@ public sealed class CategoryRowView : MonoBehaviour selectButton.onClick.RemoveListener(HandleClick); } } +} diff --git a/Assets/Scripts/UI/DicePanelView.cs b/Assets/Scripts/UI/DicePanelView.cs index 31c49c0..1997123 100644 --- a/Assets/Scripts/UI/DicePanelView.cs +++ b/Assets/Scripts/UI/DicePanelView.cs @@ -3,6 +3,9 @@ using UnityEngine; using UnityEngine.UI; using TMPro; +namespace YachtDice.UI +{ + public sealed class DicePanelView : MonoBehaviour { [Header("Dice Display")] @@ -99,3 +102,4 @@ public sealed class DicePanelView : MonoBehaviour rollButton.onClick.RemoveAllListeners(); } } +} diff --git a/Assets/Scripts/UI/GameController.cs b/Assets/Scripts/UI/GameController.cs index 385632b..fcbf1c3 100644 --- a/Assets/Scripts/UI/GameController.cs +++ b/Assets/Scripts/UI/GameController.cs @@ -1,6 +1,16 @@ using System; using System.Collections.Generic; using UnityEngine; +using YachtDice.Game; +using YachtDice.Scoring; +using YachtDice.Economy; +using YachtDice.Shop; +using YachtDice.Inventory; +using YachtDice.Persistence; +using YachtDice.Modifiers; + +namespace YachtDice.UI +{ public sealed class GameController : MonoBehaviour { @@ -345,3 +355,4 @@ public sealed class GameController : MonoBehaviour return total; } } +} diff --git a/Assets/Scripts/UI/GameInfoView.cs b/Assets/Scripts/UI/GameInfoView.cs index 575efd0..5f27b04 100644 --- a/Assets/Scripts/UI/GameInfoView.cs +++ b/Assets/Scripts/UI/GameInfoView.cs @@ -3,6 +3,9 @@ using UnityEngine; using UnityEngine.UI; using TMPro; +namespace YachtDice.UI +{ + public sealed class GameInfoView : MonoBehaviour { [Header("Turn Info")] @@ -67,3 +70,4 @@ public sealed class GameInfoView : MonoBehaviour inventoryButton.onClick.RemoveAllListeners(); } } +} diff --git a/Assets/Scripts/UI/ScoreCardView.cs b/Assets/Scripts/UI/ScoreCardView.cs index 684ee63..ce5797b 100644 --- a/Assets/Scripts/UI/ScoreCardView.cs +++ b/Assets/Scripts/UI/ScoreCardView.cs @@ -2,6 +2,10 @@ using System; using System.Collections.Generic; using UnityEngine; using TMPro; +using YachtDice.Scoring; + +namespace YachtDice.UI +{ public sealed class ScoreCardView : MonoBehaviour { @@ -107,3 +111,4 @@ public sealed class ScoreCardView : MonoBehaviour categoryRows[i].OnCategorySelected -= HandleCategorySelected; } } +} diff --git a/Assets/Scripts/YachtDice.Runtime.asmdef b/Assets/Scripts/YachtDice.Runtime.asmdef index d26c022..ef8dad3 100644 --- a/Assets/Scripts/YachtDice.Runtime.asmdef +++ b/Assets/Scripts/YachtDice.Runtime.asmdef @@ -1,6 +1,6 @@ { "name": "YachtDice.Runtime", - "rootNamespace": "", + "rootNamespace": "YachtDice", "references": [ "Unity.TextMeshPro", "Unity.InputSystem",