Files
YachtDice/Assets/Scripts/Modifiers/ModifierRuntime.cs
T
horooko bee20fd1f8 [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>
2026-02-28 19:06:57 +07:00

39 lines
904 B
C#

using System;
namespace YachtDice.Modifiers
{
[Serializable]
public sealed class ModifierRuntime
{
public string ModifierId;
public bool IsActive;
public int RemainingUses;
[NonSerialized] public ModifierData Data;
public bool IsExpired => Data != null &&
Data.Durability == ModifierDurability.LimitedUses &&
RemainingUses <= 0;
public void ConsumeUse()
{
if (Data == null) return;
if (Data.Durability != ModifierDurability.LimitedUses) return;
RemainingUses--;
}
public static ModifierRuntime Create(ModifierData data)
{
return new ModifierRuntime
{
ModifierId = data.Id,
IsActive = false,
RemainingUses = data.Durability == ModifierDurability.LimitedUses ? data.MaxUses : -1,
Data = data
};
}
}
}