fcceb0ce45
Generalize the shop from selling only ModifierDefinition to any IShopItem (modifiers + dice). Add purchase condition checks, hover tooltips, and fixed prices. Introduce PlayerModel as a facade over CurrencyBank, InventoryModel, and DiceCollection for centralized state and save/load. New files: - IShopItem interface for purchasable items - ShopCatalog SO (unified catalog for all item types) - ShopTooltipView (description on hover) - PlayerModel (aggregates player state) - DiceCollection (owned dice tracking) - DiceCatalog SO (dice definition registry) - DiceCollectionTests Modified: - ModifierDefinition/DieDefinitionSO implement IShopItem - ShopModel/ShopView/ShopItemView/ShopController use IShopItem - SaveData v3 with OwnedDiceIds - GameController uses PlayerModel for save/load - GameLifetimeScope registers new services Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
24 lines
672 B
C#
24 lines
672 B
C#
using UnityEngine;
|
|
|
|
namespace YachtDice.Shop
|
|
{
|
|
/// <summary>
|
|
/// Any item that can appear in the shop.
|
|
/// Implemented by ScriptableObject definitions (ModifierDefinition, DieDefinitionSO).
|
|
/// </summary>
|
|
public interface IShopItem
|
|
{
|
|
string Id { get; }
|
|
string DisplayName { get; }
|
|
string Description { get; }
|
|
Sprite Icon { get; }
|
|
int ShopPrice { get; }
|
|
|
|
/// <summary>
|
|
/// Whether this item can be repurchased after being owned (e.g. consumable modifiers).
|
|
/// If false, the shop marks it as "Owned" once purchased.
|
|
/// </summary>
|
|
bool IsRepurchasable { get; }
|
|
}
|
|
}
|