[Refactor] Add folder-based namespaces to all C# scripts
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "YachtDice.Tests.Editor",
|
||||
"rootNamespace": "",
|
||||
"rootNamespace": "YachtDice.Tests",
|
||||
"references": [
|
||||
"UnityEngine.TestRunner",
|
||||
"UnityEditor.TestRunner",
|
||||
|
||||
Reference in New Issue
Block a user